Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applescript: "set user interaction level to never interact" not working in illustrator

I'm trying to set it so that there's no user interaction when I open up my illustrator file using applescript, but the standard:

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

doesn't work for this plugin I have installed that checks for white overprints. If it were up to me I'd just uninstall the plugin but it's for a work pc.

I also tried clicking the button automatically (with help from Tim Joe) by using:

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

and I've tried

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

Does anyone know a way of solving this?

below is the full code as it currently stands:

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"
like image 557
man-qa Avatar asked Oct 20 '22 08:10

man-qa


1 Answers

I tracked down and installed White Overprint Detector I could see what you mean. I had to use an older version as I only have CS3, and I saw the dialog it produces when you open a document. The following worked for me to get it to dismiss:

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
like image 56
Ivan X Avatar answered Oct 24 '22 00:10

Ivan X