Kevin Wojniak wrote:
I am trying to write a method to set the Desktop picture using
Scripting Bridge and System Events.
[...]
The working AppleScript is:
set picture of desktop 1 to POSIX file "/Some/file.jpg"
FWIW, running your AppleScript through appscript's ASTranslate tool
produces the following code:
#import "SEGlue/SEGlue.h"
SEApplication *systemEvents = [SEApplication applicationWithName:
@"System Events"];
SEReference *ref = [[[systemEvents desktops] at: 1] picture];
id result = [ref setItem: [NSURL fileURLWithPath: @"/Some/file.jpg"]];
Dunno about Scripting Bridge - I have a fairly low opinion of it and
avoid it myself.
HTH
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com