Re: Renaming Picture 1
Re: Renaming Picture 1
- Subject: Re: Renaming Picture 1
- From: Arthur J Knapp <email@hidden>
- Date: Mon, 21 Jan 2002 17:53:08 -0500
>
Date: Mon, 21 Jan 2002 17:03:13 -0500
>
Subject: Renaming Picture 1
>
From: Graham Fielder <email@hidden>
>
I want to rename a file and add the date, in YY-MM-DD format. The filename
>
gets altered correctly but the date isn't added!
>
tell application "Finder"
>
set the date_slug to my format_date_using(the current date, ".", {"YY",
>
"MM", "DD"})
>
set filename to filename & " " & date_slug
You appear to have set a variable called "filename" to a string,
now you need to set the name of an actual file to the variable:
tell application "Finder"
set myFile to file "Picture 1" of startup disk --> grab file object
set date_slug to ,
my format_date_using(current date, ".", {"YY", "MM", "DD"}
set newName to (name of myFile) & " " & date_slug --> create string
set name of myFile to newName --> set name to newName
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://maccentral.macworld.com/columns/briggs.shtml>
on error number -128
end try
}