Set Finder Background Image ...

Mac OSX specific forum
jamirokwai
Addict
Addict
Posts: 802
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Set Finder Background Image ...

Post by jamirokwai »

Hi there,

you may set the background image of Finder to any jpg or png as you like using AppleScript.
I used the great CocoaScript from here: http://www.purebasic.fr/english/viewtop ... 19&t=40684

Code: Select all

Procedure SetBackgroundImage(image.s)
  a.s+"set p to " + Chr(34) + image + Chr(34) + #CRLF$
  a.s+"set a to POSIX file p" + #CRLF$
  a.s+"tell application "+Chr(34)+"Finder"+Chr(34)+#CRLF$
  a.s+"set desktop picture to a as alias"+#CRLF$
  a.s+"end tell"+#CRLF$
  COCOA_AppleScript(a.s)
EndProcedure

datei$ = OpenFileRequester(".",".",".jpg",0) 
SetBackgroundImage(datei$)
Regards,
JamiroKwai
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: Set Finder Background Image ...

Post by jesperbrannmark »

Yey! Great. Nice to see someone else is using applescript (and working on my a.s string as the nomenclature.. )
jamirokwai
Addict
Addict
Posts: 802
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Set Finder Background Image ...

Post by jamirokwai »

jesperbrannmark wrote:Yey! Great. Nice to see someone else is using applescript (and working on my a.s string as the nomenclature.. )
Hey Jesper,

thanks for the CocoaScript-Portion. I use it in many of my Apps :-)
Regards,
JamiroKwai
Post Reply