Re: move folder & copy image ? (newbie)
Re: move folder & copy image ? (newbie)
- Subject: Re: move folder & copy image ? (newbie)
- From: Michelle Steiner <email@hidden>
- Date: Tue, 7 Aug 2001 08:43:46 -0700
On 8/6/01 11:37 PM, T. Breheny / DiGiTAL ZEN <email@hidden> wrote:
>
below please find 2 different but similar non-working scripts which should
>
shed some light on what i'm _trying_ to do (hopefully):
>
>
>
----------
>
>
tell application "Finder"
>
activate
>
select file "output" of folder "clients"
>
reveal original item of selection
>
open selection
>
select every item
>
move selection to the folder which contains this folder
>
end tell
Well, it appears that "output" is an alias to a folder. Assuming that's
the case, here are my comments.
1. you have to supply the full path name to the file; e.g., file
"output" of folder "clients" of disk "macintosh HD" Personally, I would
use a file path, such as file "macintoshHD:clients:output"
2. you don't have to select it; you can work on it directly by name.
so my line of code would be
set the selectedItem to file "macintoshHD:clients:output"
3. Then instead of revealing the target of the alias, set it to a
variable
set the originalItem to the original item of the selectedItem
4. Then set the container of that folder to a variable
set the parentFolder to the container of the originalItem
5. Then set the contents of the originalitem to a variable
set the filesToBeMoved to the entire contents of the originalItem
6. Finally move the files.
here's the final code:
tell application "Finder"
set the selectedItem to file "macintosh HD:clients:output"
set the originalItem to the original item of the selectedItem
set the parentFolder to the container of the originalItem
set the filesToBeMoved to the entire contents of the originalItem
move the filesToBeMoved to the parentFolder
end tell
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------