我想从一批图像的图像日期和图像日期粘贴到另一个批次使用相同的文件名(但不同的文件类型)AppleScript的错误:-1728在创建日期对象
图像我发现一个AppleScript可以帮助我:http://brettgrossphotography.com/2008/12/10/aperture-applescript-export-restore-metadata
但是,日期部分是棘手的。
在导出部分中,我通常解析出日期,但导入部分不起作用。
if (curTagShort is "ImageDate") then
log "-- try to set the date --"
-- set curDate to (curVal as date)
set curDate to rich text of (item ctr of theList)
log (curVal as string)
adjust image date (date curVal as string) of images {curImg}
else
以上代码生成以下日志:
(*-- try to set the date --*)
(*Freitag, 26. September 2014 20:21:21*)
get date "Freitag, 26. September 2014 20:21:21" of image version id "CeT8CoCwSYuhejftq9kmag"
--> error number -1728 from date "Freitag, 26. September 2014 20:21:21" of image version id "CeT8CoCwSYuhejftq9kmag"
(*date "Freitag, 26. September 2014 20:21:21" of item 1 of {«class rkdp» id "CeT8CoCwSYuhejftq9kmag" of application "Aperture"} kann nicht in Typ string umgewandelt werden.*)
可变CURVAL是
set curVal to item ctr of theList
CTR是当前索引,的thelist是一个列表...明显。
到目前为止,对于非工作部分,如果用实际字符串“Freitag,2014年9月26日20:21:21”替换>> curVal作为字符串< <,它可以工作。
用我的AppleScript的小知识,我认为这个问题是,“CURVAL”是列表的一部分,因此
"Freitag, 26. September 2014 20:21:21" of item 1 of {«class rkdp» id "CeT8CoCwSYuhejftq9kmag" of application "Aperture"}
那么,有没有说我缺少一个把戏?
谢谢!