Ich bräuchte ein Script, mit dem ich dem Dateinamen das Hinzufügedatum voran stellen kann, nach diesem Muster:
JJJJ-MM-TT Dateiname
Wenn jemand so etwas für mich hätte, wäre das sehr nett
Ich bräuchte ein Script, mit dem ich dem Dateinamen das Hinzufügedatum voran stellen kann, nach diesem Muster:
JJJJ-MM-TT Dateiname
Wenn jemand so etwas für mich hätte, wäre das sehr nett
Das folgende Skript fügt Datum & Uhrzeit ein:
tell application "DEVONthink Pro"
try
set theSelection to the selection
if theSelection is {} then error "Please select some documents."
repeat with theRecord in theSelection
set theDate to creation date of theRecord
set theName to ((year of theDate) as string) & "-" & my twodigits(((month of theDate as integer) as string)) & "-" & my twodigits(((day of theDate) as string)) & " " & my twodigits(((hours of theDate) as string)) & ":" & my twodigits(((minutes of theDate) as string)) & " " & (name of theRecord)
set name of theRecord to theName
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell
on twodigits(theStr)
local theLen
set theLen to length of theStr
if theLen is 0 then return "00"
if theLen is 1 then return "0" & theStr
return theStr
end twodigits