Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Action the Cocoa Way



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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.