plugins - Applescript: "set user interaction level to never interact"无法在 illustrator 中工作

标签 plugins applescript adobe-illustrator

我正在尝试设置它,以便当我使用 applescript 打开我的插画文件时没有用户交互,但标准是:

tell application id "com.adobe.Illustrator"
activate
set user interaction level to never interact
open theFile without dialogs

不适用于我安装的用于检查白色叠印的插件。 如果由我决定,我会卸载该插件,但它适用于工作电脑。

我还尝试使用以下方法自动单击按钮(在 Tim Joe 的帮助下):

try
    tell application "System Events"
        tell process "Finder"
            click button "OK" of window "Adobe Illustrator"
        end tell
    end tell
end try

我已经尝试过了

tell application "System Events"
  tell process "Adobe Illustrator"
    keystroke return 
  end tell
end tell

有谁知道解决这个问题的方法吗?

下面是当前的完整代码:

set saveLocation to ((path to desktop) as string) --place to save the files
set theFile to choose file with prompt "Choose the Illustrator file to get outlines on"
set outputFolder to choose folder with prompt "Select the output folder"
tell application "Finder" to set fileName to name of theFile
set fullPath to (saveLocation & fileName) --file path of new .ai
set fileName to (text 1 thru ((length of fileName) - 3) of fileName) --remove .ai from fileName
set olPath to text 1 thru ((length of fullPath) - 3) of fullPath & "_OL.ai" --path of outlined file


 tell application id "com.adobe.Illustrator"
activate
ignoring application responses
    open theFile without dialogs
end ignoring
tell application "System Events"
    tell process "Adobe Illustrator"
        repeat 60 times -- wait up to 60 seconds for WOPD window to appear
            try
                tell window "White Overprint Detector"
                    keystroke return
                    exit repeat
                end tell
            on error
                delay 1
            end try
        end repeat
    end tell
end tell
save current document in file fullPath as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 15, font subset threshold:0.0, embed linked files:true, save multiple artboards:false} --save file to desktop
convert to paths (every text frame of current document) --convert text to paths
save current document in file olPath as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 15, font subset threshold:0.0, embed linked files:true, save multiple artboards:false} --save another copy to desktop with name + _OL.ai 

 end tell
 tell application "Finder"
set newFolder to make new folder at saveLocation with properties {name:fileName}
move fullPath to newFolder --create new folder and move both new files into it
move olPath to newFolder
set newFolderPath to (newFolder) as string
set newFolderPath to text 1 thru -2 of newFolderPath --remove the trailing ":" 

tell current application --zip up the new folder
    set qpp to quoted form of POSIX path of newFolderPath
    do shell script "cd $(dirname " & qpp & ")
zip -r  \"$(basename " & qpp & ").zip\" \"$(basename " & qpp & ")\""
end tell
set zipFile to newFolderPath & ".zip"
move zipFile to outputFolder --move .zip to output
delete newFolder --delete folder on desktop left from zipping
 end tell


 --prepare a notification email 
 set presetText to "Hello,    


 Files Uploaded: 


  " & fileName & ".zip


 To access our FTP Server: 
 http://217.207.130.162:8080/WebInterface/login.html   

 To access our FTP server, log onto our website below: 

 Username: 
 Password: 

 Thanks, 
  Joe"
tell application "Mail" --open up prepared email
activate
set theMEssage to make new outgoing message with properties {visible:true,       subject:fileName, content:presetText}
  end tell
  --open file containing usernames and passwords for the FTP
  do shell script "open /Users/produser/Desktop/FTP_Users"

最佳答案

我找到并安装了白色叠印检测器,我明白你的意思。我不得不使用旧版本,因为我只有 CS3,并且我看到了打开文档时它生成的对话框。以下内容对我有用,让它被驳回:

tell application "Adobe Illustrator" to activate
tell application "System Events"
    tell process "Adobe Illustrator"
        repeat 60 times -- wait up to 60 seconds for WOPD window to appear
            try
                tell window "White Overprint Detector"
                    keystroke return
                    exit repeat
                end tell
            on error
                delay 1
            end try
        end repeat
    end tell
end tell

关于plugins - Applescript: "set user interaction level to never interact"无法在 illustrator 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23655088/

相关文章:

c# - Adobe Illustrator 中的多段线简化是如何工作的?

zend-framework - 使用 Zend Framework 渲染站点范围元素的最佳方法

javascript - JQUERY 和 JAVASCRIPT OOP

swift - 将 AppleScript 字符串列表转换为 Swift 数组

javascript - 使用extendscript返回文件夹路径

javascript - Illustrator插件区

maven-2 - 创建 maven "target"目录的 zip 存档

java - 如何在插件操作类中获取当前文件名

cocoa - 使用 ScriptingBridge 框架与 Entourage 进行通信

macos - 如何从 SwiftUI View 中运行 AppleScript?