Re: Folder Action the Cocoa Way
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