• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting Bridge and System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Core Data - fresh data for text field not connected to array controller
  • Next by Date: Maintaining mutable values with NSDictionaryControllerKeyValuePair
  • Previous by thread: Scripting Bridge and System Events
  • Next by thread: Quartz Bindings
  • Index(es):
    • Date
    • Thread