Re: 1 to 001 & the duplicate command
Re: 1 to 001 & the duplicate command
- Subject: Re: 1 to 001 & the duplicate command
- From: Timothy Bates <email@hidden>
- Date: Fri, 31 May 2002 10:27:38 +1000
>
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).
Sorry. AS has no build-in GREP, find and replace, or sprintf-like commands
>
second, I was trying to use the Finder duplicate command
>
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"
>
I was expecting to see
>
file "sign-on list copy" of application "Finder" as the result.
You were: if you get the path to your new file you will see it is the
duplicate, but the Finder did not need to add "copy" as you made it in a
distinct folder, so it let the name alone for you.
Now just do
set name of blah_dup to "new name"
Tim
_______________________________________________
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.