Re: deeply frustrating: how to copy/move a file from one place to another
Re: deeply frustrating: how to copy/move a file from one place to another
- Subject: Re: deeply frustrating: how to copy/move a file from one place to another
- From: Andrew Oliver <email@hidden>
- Date: Mon, 02 Feb 2004 11:19:39 -0800
Actually, moving files is best performed by the Finder. Since you're writing
a droplet, you can be fairly confident the Finder is running.
on open theFiles
tell application "Finder"
move theFiles to folder "LB" of (path to sites folder)
end tell
end open
Note the use of 'path to..." to find the Sites folder. This saves you having
to hard-code the folder name and makes your script more portable.
Andrew
:)
On 2/2/04 10:45 AM, "Charles Arthur" <email@hidden> wrote:
>
Yes, sounds obvious. And it was, as I recall, in the OS9 days.
>
>
However in X, unless I'm missing a seriously big trick, it's very hard to
>
say "Move this file to there".
>
>
I want to write a droplet so that files dropped on it will be moved to a
>
particular directory for a user. Vanilla AS. 10.3.
>
>
I've got as far as finding that I should be instructing System Events,
>
which has the "move" command:
>
move: Move object(s) to a new location.
>
move reference -- the object for the command
>
to location reference -- The new location for the object(s).
>
>
So if I want to move my file to what the for user is ~/Sites/LB/ , what's
>
the syntax?
>
>
Can it really be as simple as
>
on open(thefile)
>
tell application "System Events"
>
move thefile to "~/Sites/LB/"
>
end tell
>
end open
>
>
?
>
>
Thanks for help..
>
>
Charles
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.