上周我问了一个关于这个脚本的一部分的问题,并且有一些真正有用的回复让我朝正确的方向发送。我意识到我可以在脚本的最后添加一些,这里是我的。这个脚本在80%的时间内完全正常工作 - 当出现错误时它说找不到文档1的属性。我想我通过添加行集mydoc到文档1来解决这个问题。在哪里添加了它,但我认为它仍然是有时被视为未定义的变量。有没有更好的方式来说明这一点?另一个问题是,有时我可能在下载文件夹中有2或3个文件。我需要为每个文件重复吗?目标是在打开Illustrator文档时添加3种专色。 这里是我目前错误:找不到文档1的属性
tell application "Finder"
set JobName to text returned of (display dialog "Please enter Job Name:" default answer "Job_Name")
set loc to desktop
set newfoldername to JobName
set newfo to make new folder at loc with properties {name:newfoldername}
make new folder at newfo with properties {name:JobName & "_Seps"}
make new folder at newfo with properties {name:JobName & "_DTG"}
set the clipboard to JobName
end tell
tell application "Finder"
open folder JobName
move (files of alias "Macintosh HD:Users:username:Downloads") to newfo
end tell
tell application "Adobe Illustrator"
open files in newfo
end tell
tell application "Adobe Illustrator"
set mydoc to document 1
set docColorSpace to color space of document 1
if (docColorSpace is CMYK) then
set SpotColor to {cyan:21.0, magenta:0, yellow:100.0, black:0.0}
else
set SpotColor to {red:206.0, green:219.0, blue:41.0}
end if
make new spot in document 1 with properties {name:"Highlight White", color type:spot color, color:SpotColor}
end tell
tell application "Adobe Illustrator"
set docColorSpace to color space of document 1
if (docColorSpace is CMYK) then
set SpotColor to {cyan:11.0, magenta:100, yellow:30.0, black:0.0}
else
set SpotColor to {red:215.0, green:23.0, blue:111.0}
end if
make new spot in document 1 with properties {name:"Under Base", color type:spot color, color:SpotColor}
end tell
tell application "Adobe Illustrator"
set docColorSpace to color space of document 1
if (docColorSpace is CMYK) then
set SpotColor to {cyan:0.0, magenta:0, yellow:0.0, black:100.0}
else
set SpotColor to {red:35.0, green:34.0, blue:33.0}
end if
make new spot in document 1 with properties {name:"Spot Black", color type:spot color, color:SpotColor}
end tell
标题应该描述问题。 –
你能否再次格式化代码?它很难读取,因为它是。 – Mark
对不起,关于蹩脚的标题和格式 - 我从工作中发邮件给我自己,并从我的手机上发布,尽管我第一次没有正确格式化。 – jamthelows