Re: New scripter Q: calling upon a generic file name?
Re: New scripter Q: calling upon a generic file name?
- Subject: Re: New scripter Q: calling upon a generic file name?
- From: email@hidden
- Date: Tue, 4 Mar 2003 20:30:18 EST
Thanks for the suggestions below. However, they didn't solve the issue.
To clarify: What I was trying to accomplish was to copy a file named "Heinz
List" from a folder of the same name that resides on a disk named "Heinz 57".
My primary post may not have been clear on this.
Kai's suggestion:
>
tell application "Finder"
>
set d to (disks whose name begins with "Heinz")'s name
>
set c to disk d's folders whose name is d & " List"
>
set f to (c's item 1)'s files whose name is d & " List"
>
duplicate f to alias "Macintosh HD:Heinz F :"
>
end tell
resulted in an error whereby the Finder "can't get item 1 of Heinz 57".
Modifying the script several ways didn't work out, either.
Al's thought that "duplicate" might work, rather than "copy":
>
duplicate <file(s)> to <file(s)> with replacing
resulted in the error "Invalid key form".
I then tried a longer route for this task, with the following:
tell application "Finder"
activate
set drvName to (name of every disk whose name begins with "Heinz")
select disk (drvName)
open selection
set fldrName to (name of every folder of disk drvName whose name starts
with "Heinz List")
duplicate fldrName to "Macintosh HD:Heinz" with replacing
close container window of disk drvName
end tell
but that got the same result, with or without "with replacing".
I'm now convinced that there is a problem discriminating between two items
with the same exact name, even if one is a file and the other a folder. It's
kind of like those characters in the old TV show *Newhart*:
"This is my brother Darryl, and this is my other brother Darryl."
. . . but I'm still open to suggestions. Thanks again.
Mike
email@hidden
**************************************************
The trouble with political jokes is they get elected.
bUnknown
_______________________________________________
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.