Re: Move files w/AppleScript ??
Re: Move files w/AppleScript ??
- Subject: Re: Move files w/AppleScript ??
- From: Axel Luttgens <email@hidden>
- Date: Thu, 15 Jan 2004 09:28:06 +0100
Denis Somar wrote:
Hi all,
I'm transferring some old scripts to OS X.3 and have had trouble with all of
my move commands. Is there any special trick involved in moving file a from
folder A to folder B ?? Any code snippets around?
Cheers,
Denis
You don't tell about the troubles you are encountering.
If needed, it could be worth to be more precise (sample code, error
messages...).
In the meantime, I tried this snippet:
tell application "Finder"
set srcF to folder "f1" of desktop
set dstF to folder "f2" of desktop
move every item of srcF to dstF
end tell
which seems to work s usual.
If, instead of moving every file/folder from source to destination, you
want to move s single item, you just need to change fourth line; for
example:
move file "xxx" of srcF to dstF
or, in order to be more general,
move item "xxx" of srcF to dstF
as the file/folder distinction is generally irrelevant in case of a move
operation.
In a word, nothing new seems to have been introduced for such matters
with MacOS 10.3.
Well, nothing that appeared to me ;-)
Now, if you are jumping from MacOS 9 (or erlier) to Panther, there is of
course the permissions question; you need to be allowed to change the
source folder as well as the destination folder.
Finally, as a reminder, here follows the relevant entry from the
Finder's dictionary:
move: Move object(s) to a new location
move reference -- the object(s) to move
to location reference -- the new location
for the object(s)
[replacing boolean] -- Specifies whether or
not to replace items in the destination that
have the same name as items being moved
[positioned at list] -- Gives a list (in local
window coordinates) of positions for the
destination items
[routing suppressed boolean] -- Specifies whether
or not to autoroute items (default is false).
Only applies when moving to the system folder.
Result: reference -- to the object(s) after they
have been moved
HTH,
Axel
_______________________________________________
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.