Christopher Dare Applescript to get modified date of file selected in Yojimbo
Jan 14, 2008; 07:35
Christopher Dare
Applescript to get modified date of file selected in Yojimbo
Hi there!
I want an Applescript that will grab the modified date of a file selected in Yojimbo.
Here is how I want it to work: 1) Select file in Yojimbo 2) Execute an applescript. (either from the Script menu, or Quicksilver or TypeIt4Me/TextExpander) 3) The Applescript gets the Modified date of the selected file 4) The applescript returns the modified date in form yymmdd_hh-mm-ss
Basically I'm thinking of creating a TypeIt4Me snippet that executes this applescript and returns me that value when I am renaming files in Yojimbo.
Below is a script I use to do the same thing, but in the Finder. i.e. the script gives me the modified date of a file selected in the Finder. I want to do a similar thing in Yojimbo.
Any ideas?
[code] tell application "Finder" to repeat with MyItem in (get selection) do shell script "mdls " & quoted form of POSIX path of (MyItem as text) & " | grep 'kMDItemContentModificationDate' | awk '/ = / {print $3,$4}'"
tell the result to set ModDate to text 3 thru 4 & text 6 thru 7 & text 9 thru 10 & "_" & text 12 thru 13 & "-" & text 15 thru 16 & "-" & text 18 thru 19
-- display dialog "Modification date: " & ModDate with title (get name of MyItem)
return ModDate end repeat [/code]
Jan 14
Steve Kalkwarf Re: Applescript to get modified date of file selected in Yojimbo
Jan 14, 2008; 08:26
Steve Kalkwarf
Re: Applescript to get modified date of file selected in Yojimbo
Jan 15
Christopher Dare Re: Applescript to get modified date of file selected in Yojimbo
Jan 15, 2008; 10:15
Christopher Dare
Re: Applescript to get modified date of file selected in Yojimbo
Jan 15
Steve Kalkwarf Re: Applescript to get modified date of file selected in Yojimbo
Jan 15, 2008; 16:24
Steve Kalkwarf
Re: Applescript to get modified date of file selected in Yojimbo
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!