Re: linimg to moving target with folder actions
Re: linimg to moving target with folder actions
- Subject: Re: linimg to moving target with folder actions
- From: "Bryan" <email@hidden>
- Date: Tue, 30 Jan 2001 13:35:17 -0500
you need two scripts, one which attaches the folder action to a chosen
folder; and the other to perform the action which is attached by the first.
Although you could build a script which attaches itself and then becomes a
folder action, you would have to run it from inside an editor. This is
because folder actions are not applets, and compiled scripts are not
executables.
Bryan Kaufman
----------
>
From: brian <email@hidden>
>
To: <email@hidden>
>
Subject: linimg to moving target with folder actions
>
Date: Now Tue, Jan 30, 2001, 01:49 AM
>
>
I'm trying to create a script to be used as a folder action that will ask
>
for user input to choose a target folder the first time it runs and
>
subsequently use the provided info to copy files from a local hard drive to
>
a moving target folder (name remains constant) on a server. So far I'm
>
stumped.
>
>
I can (outside of Applescript) manually create an alias of the target folder
>
and put it on my desktop and since the name of the folder is constant the
>
Finder seems to have no trouble finding it on the server no matter where it
>
gets moved to.
>
>
Unfortunately, when I tried to script this approach in Applescript, I end up
>
with a -43 error (can't remember exact translation from apple's site but it
>
was basically can't find the file or dir you specified...)
>
>
Tried to set the alias in Applescript, which worked until I moved the target
>
folder. After the move I ended up with -120 errors also a can't get dir
>
error.
>
>
Also tried to use the folder action syntax of on adding items....preceeded
>
by a few choose folder prompts and attach that to the source folder:
>
>
set target to choose folder with prompt "target?"
>
set source to choose folder with prompt "source?"
>
on adding folder items to source after receiving added_items
>
tell application "Finder"
>
move every item of source to target
>
end tell
>
end adding folder items to
>
>
Since I can't get any of these to work I'm now resigning myself to building
>
an app that runs constantly watching the source folder and moving its items
>
to the target folder that I could make a startup item. Problem solved, but
>
I'd still like to know if its possible use the more elegant folder action
>
approach to eliminate a constantly running app? Or am I just being too hard
>
on myself?
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users