1

我尝试使用以下 Applescript 按 id 在照片的 iPhotoLibrary 中选择路径:

tell application "iPhoto" set photoID to 25801 set thePhoto to photo id (photoID + 2 ^ 32) set photoPath to the Photo end tell

这不起作用,因为 Applescript 告诉我,无法将 4.294993097E+9 转换为整数。我将(photoID + 2 ^ 32) 写为数字,Applescript 无法获取图像路径。

请告诉我我的错误是什么,我该如何解决这个问题。

4

1 回答 1

0

您必须首先通过在 iPhoto 中搜索从 ID 中获取“照片”对象,然后仅获取该对象的路径:

set myPhoto to first item of (every photo whose id is myId)
set myPath to image path of myPhoto

myPath 是 Unix 格式的完整文件路径(带有'/'而不是':')

于 2016-10-17T13:17:14.600 回答