AppleScript - 查找文件的创建/修改日期

时间:2011-02-05 11:43:10

标签: date time timestamp applescript evernote

我使用简单的服务来导入Evernote文件:

运行{input}     告诉应用程序“Evernote”         在输入中用x重复             尝试                 从文件x创建注释             出错时error_message number error_number                 显示警告“发送到Evernote失败”消息“错误:”& error_message& “”& “错误号码:”& error_number作为警告             结束尝试         结束重复     结束告诉 结束

我想“从文件x创建d创建注释”,其中d是与原始文件匹配的日期/时间 - 但我不知道如何获取日期/时间(创建或修改)原始文件格式为AppleScript日期。

我很感激帮助!

1 个答案:

答案 0 :(得分:0)

我不知道你从哪里得到你的“输入”,但假设你用“文件”来表示Finder中的文件,调用Finder来获取“输入”中文件的信息应该像这样工作:

tell application "Finder" to set input to selection
repeat with x in input
    tell application "Finder" to set creationDate to creation date of x  
end repeat