• 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: Need Suggestions For appending Date to Filename
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need Suggestions For appending Date to Filename


  • Subject: Re: Need Suggestions For appending Date to Filename
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 5 May 2005 08:02:34 -0700


On May 5, 2005, at 12:48 AM, Jack Stewart wrote:

For many tears I used a file naming protocol which includes suffixing filenames which I create with the current date. I use the format "/YYMMDD" for the date. (Yes, I am aware of the the potential Unix conflict using the "/" character).

I have been trying to think of a real simple way to create a keyboard shortcut which I could use to append this date string to any filename which I happen to be typing. I'm not having any great ideas. I think that calling Applescript is probably too slow but maybe I have the blinders on.

Here is a script with two options that will do it for you; I don't know how you can execute them by a keystroke, though. (Note: this script assumes USA date formatting.O


tell application "Finder"
    set selectedFile to item 1 of the selection
    set the fileName to the name of the selectedFile
    set today to my thisDate()
    set the name of the selectedFile to the fileName & today
end tell

on thisDate()
set today to (current date)
(* option 1
set text item delimiters to "/"
set today to text items of today
set text item delimiters to ""
set targetformat to "/" & text item 3 of today & text items 1 through 2 of today
return targetformat
*)
(* option 2
set today to "/" & text 7 through 8 of today & text 1 through 2 of today & text 4 through 5 of today
return targetformat
*)
end thisDate


Remove the comments from the option you would rather use.

-- Michelle

--
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Need Suggestions For appending Date to Filename (From: Jack Stewart <email@hidden>)

  • Prev by Date: System Events (was Re: Frontmost)
  • Next by Date: Re: Getting filename without extension...
  • Previous by thread: Need Suggestions For appending Date to Filename
  • Next by thread: Re: Need Suggestions For appending Date to Filename
  • Index(es):
    • Date
    • Thread