Re: Folder Actions: Use non-scripts?
Re: Folder Actions: Use non-scripts?
- Subject: Re: Folder Actions: Use non-scripts?
- From: "Eric M. Williams" <email@hidden>
- Date: Fri, 22 Apr 2005 12:40:48 -0700
=Is it possible to attach a normal, non-AppleScript application as a
Folder Action in OS X? The Folder Actions interface seems to only
allow
compiled scripts.
A compiled script can simply be:
tell application "Smile" to launch
Of course, I could write a wrapper script that passes the event on to
my application, but it would be nice to get the event directly and
avoid this kind of hack.
That's not a hack. That's the point.
Anyway, the question is a little oddly formed. To "attach an
application",
you must mean that you want the application to do something when there
is a
"folder action", such as adding something to it, or whatever.
Precisely. I'd rather attach my application directly than having the
intermediate step of a compiled script that relays the events to my
application. Here's just a few good reasons:
- Simpler user interface. You must have your scripts in
/Library/Actions or ~/Library/Actions, or they don't work. So, in order
to work, my wrapper script has to be placed in a special folder;
manually, by the user, or by using an installer of some sort. I dislike
the idea of having pieces of my application scattered throughout the
filesystem.
- Less error-prone. What if the user renames my application? The
compiled script could break without any warning. Plus, Folder Action
scripts are very difficult to troubleshoot because the Folder Actions
server application doesn't give any indication when an error has
occurred in the script.
- Less complexity. When something goes wrong and I have to provide
support, there's a lot more troubleshooting to be done when AppleScript
is calling my application's Apple Event handler.
In short, I'm not nuts, nor am I inexperienced. :) It looks like the
Folder Actions server is not sending Apple Events as I first thought,
but is actually loading and calling one of the script's handlers, which
will obviously not work for a compiled application.
Eric M. Williams
Oxalyn Software
http://software.oxalyn.com/
AE Monitor
http://software.oxalyn.com/AEMonitor/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden