Re: Scripting Bridge and System Events
Re: Scripting Bridge and System Events
- Subject: Re: Scripting Bridge and System Events
- From: has <email@hidden>
- Date: Sat, 27 Dec 2008 08:33:33 +0000
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 (email@hidden)
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:
This email sent to email@hidden