Apple Photos使用AppleScript导出收藏夹

时间:2017-04-29 08:31:09

标签: applescript apple-photos

我正在尝试找到一种方法来执行以下导出

目前的结构 度蜜月 县    市      专辑

我想将结构导出为我的图片文件夹

蜜月>县>城市>专辑>照片名称

但我只想选择已经编辑过的照片(通常是受欢迎的)

我找到了一个允许我选择相册并导出其内容的AppleScript

set dest to "/Users/adammann/Pictures/HoneymoonExports" as POSIX file as text -- the destination folder (use a valid path)
tell application "Photos"
  activate
  set l to name of albums
  set albNames to choose from list l with prompt "Select some albums" with multiple selections allowed
  if albNames is not false then -- not cancelled
  repeat with tName in albNames
  set tFolder to dest & tName
  my makeFolder(tFolder) -- create a folder named (the name of this album) in dest 
  export (get media items of album tName) to (tFolder as alias) without using originals
  end repeat
  end if
end tell
on makeFolder(tPath)
  do shell script "mkdir -p " & quoted form of POSIX path of tPath
end makeFolder

但是我无法让它只导出它出口的“最喜欢的”。

如果有人可以帮助或指出我正确的方向,我会很高兴

提前致谢

1 个答案:

答案 0 :(得分:0)

只需使用过滤器:

export (get media items of album tName whose favorite is true) to (tFolder as alias) without using originals