• 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: Folder Action the Cocoa Way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Action the Cocoa Way


  • Subject: Re: Folder Action the Cocoa Way
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 26 Jun 2006 11:59:20 +0200

Am 25.06.2006 um 20:06 schrieb Mark Butler:
NSAppleScript *folderActionScript;

folderActionScript=[[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to attach action to \"Internal:private:tmp:TestFolder:\" using \"Internal:private:tmp:RGB-Finder.scpt\""];

[folderActionScript executeAndReturnError:nil];


Works great. It is a little slow on the first execution.. Guessing that is because it has to compile the script first. Since the paths arent static I cant really per-compile the scripts.

You could also write this script as a handler that takes parameters and then use executeAppleEvent to call the handler and pass it the parameters. That way you could compile it once at startup, and then only do the executeAppleEvent: call each time to pass your paths to the script.


Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Folder Action the Cocoa Way (From: Mark Butler <email@hidden>)
 >Re: Folder Action the Cocoa Way (From: Pablo Pons Bordes <email@hidden>)
 >Re: Folder Action the Cocoa Way (From: Mark Butler <email@hidden>)

  • Prev by Date: Re: Folder Action the Cocoa Way
  • Next by Date: Re: Off-Topic: Communicating with users
  • Previous by thread: Re: Folder Action the Cocoa Way
  • Next by thread: how do I put an object in a dictionary, change the object but leave the dict untouched?
  • Index(es):
    • Date
    • Thread