Apple脚本从InDesign色板列表中删除默认色板

时间:2014-08-05 00:41:47

标签: macos applescript adobe-indesign

我试图让InDesign列出文档中的所有颜色而不列出默认的

“无”,“纸张”,“黑色”,“注册”

这就是我所拥有的,但AS一直在输出中列出“无”,“纸张”,“黑色”,“注册”。

tell application "Adobe InDesign CC 2014"
activate
delete unused swatches of document 1
set notusedSwatches to {"None", "Paper", "Black", "Registration"}
set upDatedList to get (name of swatches of document 1 whose name is not in notusedSwatches)
end tell

4 个答案:

答案 0 :(得分:0)

遗憾的是,这不起作用......

但有趣的是,你可以像这样指定一个名称

set upDatedList to get (name of swatches of document 1 whose name is not "black"

将排除黑色。

所以你必须像这样循环遍历

set usedSwatches to {}
tell application "Adobe InDesign CC"
    --activate
    delete unused swatches of document 1
    set notusedSwatches to {"none", "paper", "black", "registration"}
    set theSwatches to name of swatches of document 1
    repeat with aSwatch in the theSwatches
        if aSwatch is not in notusedSwatches then copy aSwatch to end of usedSwatches
    end repeat
    return usedSwatches
end tell

或者每当你使用swatch名称时你做了一些检查以确保它不在“notusedswatch”列表中

答案 1 :(得分:0)

将未使用的字符串转换为字符串并且可以正常工作

set notusedSwatches to {"None", "Paper", "Black", "Registration"} as string

答案 2 :(得分:0)

我有一个列表过滤子程序,我用它。它需要两个列表。原始文件和要从原文中过滤掉的项目列表。

set allSwatches to {"Red", "White", "None", "Paper", "Black", "Registration", "Green", "Orange"}
set notusedSwatches to {"None", "Paper", "Black", "Registration"}
set filteredSwatches to filterList(allSwatches, notusedSwatches)


on filterList(theList, badItems)
    set goodList to {}
    repeat with i from 1 to (count theList)
        set currItem to item i of theList
        if currItem is not in badItems then
            set end of goodList to currItem
        end if
    end repeat
    return goodList
end filterList

答案 3 :(得分:-1)

查看this link

  

要检查并删除文件中不需要的颜色样本,请执行以下操作:单击“样本”调板的右上角,选择“全选未选”,然后单击要删除的垃圾箱。如果您在文件中留下了不需要的样本,则文档中的某些元素将使用该颜色。单击该样本并尝试删除它。如果文档中没有带有该样本的嵌入或链接文件,系统将提示您将颜色(在文档中的某个位置使用)更改为调色板中的其余颜色之一并解决问题!如果样本无法被删除,则它已从“放置”项目到达您的调色板。您必须在其原生应用程序中查看链接的徽标,艺术品或照片,以将颜色重新定义为您工作中所需的颜色。重新链接后,该样本将被释放以从调色板中删除。