1 to 001 & the duplicate command
1 to 001 & the duplicate command
- Subject: 1 to 001 & the duplicate command
- From: Stephen Swift <email@hidden>
- Date: Thu, 30 May 2002 17:06:17 -0400
I've been scripting away, and have encountered a few oddities this week.
I had to create a script where all numbers were 3 digits so
1 --> 001
10 --> 010 etc, etc
This was simple enough with a little code, but I was just curious if there
is a coercion which allows a number to have leading zeros (by default
AppleScript changes 001 to 1).
And seconding, I was trying to use the duplicate command in the Finder (Mac
OS 8.6).
Duplicate a file & change it's name.
set blah to choose file
tell application "Finder"
set blah_folder to container of blah
set blah_duplicate to duplicate blah to blah_folder without replacing
end tell
blah_duplicate
--> file "sign-on list" of application "Finder"
Now file "sign-on list" is the original file not the duplicated file. From
the Finder's dictionary:
"Result: reference -- to the duplicated object(s)"
I was expecting to see
file "sign-on list copy" of application "Finder" as the result.
Is this a Mac OS 8.6 bug only, or is this just how AppleScript works? I'd
like to be able to get an alias or reference to the duplicated file without
using it's name (because what if there already exists a file named "sign-on
list copy"? The duplicate's name would be "sign-on list copy 1". And I
don't really want to go through a whole process of determining the name
through a bunch of exists statements. Any ideas? TIA
Stephen Swift
email@hidden
-----------------------------------------------
AppleScript Guru - The Mac Observer
http://www.macobserver.com/tips/applescript
_______________________________________________
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.