Apple:

2014-05-14 7 views
5

Ich versuche es in Illustrator arbeitet nicht „Einstellung der Benutzerinteraktionsebene nie in Wechselwirkung treten“ zu setzen, so dass es keine Interaktion mit dem Benutzer ist, wenn ich meine Illustrator-Datei mit Applescript öffnen, aber der Standard:Apple:

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

funktioniert nicht für dieses Plugin Ich habe installiert, dass auf weiße Überdrucke überprüft. Wenn es nach mir ginge, würde ich nur das Plugin deinstallieren, aber es ist für einen Arbeits-PC.

Ich habe auch versucht die Taste automatisch klicken (mit Hilfe von Tim Joe) unter Verwendung von:

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

und ich habe versucht,

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

Kennt jemand eine Möglichkeit, dies zu lösen?

unten ist der vollständige Code, wie es derzeit steht:

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" 
+0

Wie lautet der Name des Plugins? –

+0

Ich denke, es heißt: Weiß OP-Detektor, anscheinend ist es von worker72a.com gemacht, was auch immer das bedeutet:/ –

Antwort

1

Seit meinem ursprünglichen Beitrag zu Ziel schien zu verstehen, ich revidieren wird.

Mit in der Tell-Block für Illustrator suchen Sie nach Ihrer Zeile, die die Datei öffnet. Einige Befehle erlauben mit und ohne Eigenschaften. Versuchen Sie, die Eigenschaft "ohne Dialoge" so zu verwenden, dass sie so aussieht.

tell application id "com.adobe.Illustrator" 
     open file (VariableOfFilePath) without dialogs 
    end tell 

Update:

Zwei Workarounds ich denken kann. 1) Versuchen Sie Systemereignisse erzählen AI zu erzählen, ohne Dialoge zu öffnen

tell application "system events" 
    tell application id "com.adobe.Illustrator" 
     open file (VariableOfFilePath) without dialogs 
    end tell 
end tell 

Andere ist fügen Sie einfach ein bisschen, das wird die Eingabeaufforderung nur okay.

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

Kann versuchen, es einfach akzeptieren die Standardschaltfläche.

tell application "System Events" 
    tell process "Finder" 
     keystroke return 
    end tell 
end tell 
+0

Das Problem ist, er erhält Aufforderungen, wenn er eine Datei öffnet, ich schlage vor, ein "ohne Dialoge" Postfix enthalten. Weniger zu stimmen, als weitere Klärung zu suggerieren, ist nicht vorteilhafter. –

+0

Danke für die Hilfe Tim Joe, aber ich hatte das bereits in meinem Code, nur nicht in dem Ausschnitt, den ich gepostet habe, ich habe die Frage bearbeitet, um zu zeigen, wie ich es ausdrücke. –

+0

Danke nochmal aber der Button Klick hat auch nicht funktioniert, ich habe das "weiter" auf "OK" geändert als das was der Button sagt, glaubst du könnte es sein, weil das Fenster anders heißt? Ps Ich habe meinen Code aktualisiert –

2

Ich suchte und installierte White Overprint Detector Ich konnte sehen, was Sie meinen. Ich musste eine ältere Version verwenden, da ich nur CS3 habe, und ich sah den Dialog, den es erzeugt, wenn Sie ein Dokument öffnen. Das folgende funktionierte für mich, um es zu entlassen:

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 
+0

Ich habe versucht, Ihre Lösung, aber es hat nicht funktioniert für mich. Wo in Ihrem Code haben Sie die Datei geöffnet? Ich habe versucht, es einzustellen, bevor "Systemereignisse sagen" und nach dem Ende für Systemereignisse erzählen, aber keiner funktionierte. –

+0

Ich schaue später nach. Können Sie in der Zwischenzeit versuchen, den Befehl zum Öffnen einer Datei zwischen "Ignorieren von Anwendungsantworten" und "Ignorieren ignorieren" zu setzen und zu melden, was Sie erhalten haben? –

+0

Ich habe es versucht, und es stoppt nicht das weiße Überdruck-Pop-up, aber es bricht einen späteren Teil meines Codes. Ich habe den vollen Code jetzt hochgeladen. –