上週我問了一個關於這個腳本的一部分的問題,並且有一些真正有用的回覆讓我朝正確的方向發送。我意識到我可以在腳本的最後添加一些,這裏是我的。這個腳本在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