New scripter Q: calling upon a generic file name?
New scripter Q: calling upon a generic file name?
- Subject: New scripter Q: calling upon a generic file name?
- From: email@hidden
- Date: Thu, 27 Feb 2003 20:38:27 EST
Hi:
There is an issue, however minor, that I have with calling upon a recurring
file by a "generic" name. The only difference is that each week the disk's
numbers -- disk, folder and file -- increase by a factor of one.
If one has a CD-ROM with a name that changes only by number from week to
week, but retains its' "first name" I am able to script access to the disk
without problems. However, if I need to access a file within a folder that
possesses the same name there are hang-ups. For example, if I get a disk
named "Heinz 57" I can open the disk by calling upon it as:
tell application "Finder"
activate
set drvName to (name of every disk whose name begins with "Heinz")
open drvName
end tell
But when I need to open/copy a file named "Heinz 57 List" that sits in a
folder named "Heinz 57 List" on the disk named "Heinz 57" I get only a
message stating that "an error of the type 13579 has occurred." No
explanation for this is given. An example of the script I wrote is as follows:
tell application "Finder"
activate
set drvName to (name of every disk whose name begins with "Heinz")
copy (((file whose name begins with "Heinz List") of folder whose name
begins with "Heinz List") of item drvName) to item "Macintosh HD:Heinz F"
end tell
Please note that no matter where I place the parentheses this error code
appears. I'm wondering, first of all, if this error code is legit. Secondly,
can someone explain to me why this is happening, and is there a workaround?
(Mac OS 8.6)
Mike
email@hidden
*******************************************
"The secret of life is honesty and fair dealing.
If you can fake that, you got it made."
bGroucho Marx
_______________________________________________
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.