Re: Can't re-name file with time stamp
Re: Can't re-name file with time stamp
- Subject: Re: Can't re-name file with time stamp
- From: Nigel Garvey <email@hidden>
- Date: Thu, 21 Feb 2002 13:40:33 +0000
Graham Fielder wrote on Wed, 20 Feb 2002 16:14:30 -0500:
>
I have a simple script in which I want to replace the name of a file with a
>
Time stamp.
>
>
tell application "Finder"
>
>
display dialog " Time " & the time string of (the current date)
>
>
set name of "TEST" to " Time " & the time string of (the current date)
>
>
end tell
>
>
The time dialog is displayed correctly but I get an error message saying :-
>
>
"Can't set name of "TEST " to "Time 21:04:20.".
>
>
What am I doing wrong?. (Using OS 9.2.2/AS 1.7)
Several people have already pointed out the problem with colons in file
names. Your script also omits the word 'file' from before the file name.
Without that, you're trying to set the name of a string (which is
nonsense) instead of the name of a file (which isn't). The file is
assumed to be on the desktop in this particular case, otherwise you need
more path information.
NG
_______________________________________________
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.