• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Renaming Picture 1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
}


  • Prev by Date: Re: Scripting Mail.app
  • Next by Date: UnZip with StuffIt
  • Previous by thread: Re: Renaming Picture 1
  • Next by thread: Re: Renaming Picture 1
  • Index(es):
    • Date
    • Thread