Re: Programatically Uncheck "Change Picture" In Desktop Settings?
Re: Programatically Uncheck "Change Picture" In Desktop Settings?
- Subject: Re: Programatically Uncheck "Change Picture" In Desktop Settings?
- From: has <email@hidden>
- Date: Sat, 14 Feb 2009 12:35:27 +0000
Chunk 1978 wrote:
when running my apple script i get this error:
-=-=-=-
System Events got an error: Access for assistive devices is disabled.
-=-=-=-
so if i goto system prefs and check "Enable access for assistive
devices", then running the script i get this error:
-=-=-=-
System Events got an error: Can't get application process "System
Preferences".
Did you remember to activate System Preferences first?
activate application "System Preferences"
tell application "System Events"
tell application process "System Preferences"
...
end tell
end tell
However, before going down the GUI Scripting route, which is brittle
and prone to failure, check out the Desktop Suite in System Events.
The APIs a bit schlonky, but it may do what you want. Example using
objc-appscript:
#import "SEGlue/SEGlue.h"
SEApplication *systemEvents = [SEApplication applicationWithName:
@"System Events"];
SEReference *ref = [[systemEvents currentDesktop] pictureRotation];
id result = [ref setItem: [NSNumber numberWithInt: 0]];
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