繁体   English   中英

如何使用AppleScript在OSX Photos中的命名文件夹中创建/制作相册?

[英]How do I create/make an album in a named folder in OSX Photos with AppleScript?

我正在寻找一种解决方案,使我可以在本地运行AppleScript来拍摄OSX Photos应用程序“智能文件夹”中的一堆照片,并将其放入非智能等效文件中。 我发现了一个脚本,主要是这样做的:

on run {input, parameters}
    tell application "Photos"
        get folder "Managing the library"
        set smartAlb to album "Measurements"
        set regAlbName to "Measurements-Static"
        tell album regAlbName to if exists then delete
        set regAlb to make new album named regAlbName
        add (get media items of smartAlb) to regAlb
    end tell
end run

但是,虽然我可以设置从中获取信息的文件夹,但新相册是在“照片”的顶层创建的。 我要做的只是对显示的代码进行调整,以确保在同一文件夹中创建新专辑(当前称为“管理库”)。 我已经尝试了各种方法,但是我不是AppleScript的常规用户,并且无法在线找到答案。

感谢人们可以提供的任何帮助:)

您必须在创建新文件夹的位置添加位置信息。 不仅仅是获取文件夹, Managing the library将引用分配给变量,并将其传递到make new album行中。

on run {input, parameters}
    tell application "Photos"
        set manageFolder to folder "Managing the library"
        set smartAlb to album "Measurements"
        set regAlbName to "Measurements-Static"
        tell album regAlbName to if exists then delete
        set regAlb to make new album named regAlbName at manageFolder
        add (get media items of smartAlb) to regAlb
    end tell
end run

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM