2014-05-14 2 views
5
내가 AppleScript로를 사용하여 내 일러스트 레이터 파일을 열어 사용자 상호 작용이 없다 있도록 설정하기 위해 노력하고있어

작동하지 "로 설정 사용자 상호 작용 수준의 상호 작용 결코"하지만 표준 :AppleScript를이 : 일러스트 레이터

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

이 플러그인이 흰색 겹침 확인을 설치했는데 작동하지 않습니다. 그것이 나에게 달린 것이라면 나는 플러그인을 제거 하겠지만 작업용 PC를위한 것이다.

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

플러그인의 이름은 무엇입니까? –

+0

나는 그것이라고 불렀다 : white OP detector, 그것이 분명히 worker72a.com에 의해 만들어 졌음을 의미한다./ –

답변

1

내 원래의 게시물은 내가 수정됩니다 이해하기 너무 목적 보였다입니다.

일러스트 레이터의 tell 블록에서 파일을 여는 행을 찾으십시오. 일부 명령은 속성의 유무를 허용합니다. "대화 상자가없는"속성을 적용하여 다음과 같이하십시오.

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

업데이트 : 내가 생각할 수있는

두 작업 방법. 1) 대화 상자 조금 것이다 알았지 프롬프트에 추가되어 다른

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

없이 열 AI에게 시스템 이벤트를 말해보십시오.

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

기본 버튼을 수락하면됩니다.

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

문제는 그가 파일을 열었을 때 프롬프트가 나타나고 "without dialogs"접미사를 포함 시키라고 제안하고있다. 오히려 그때 더 명확한 제안을 제안하기 위해 아래로 투표하는 것이 더 이상 도움이되지 않습니다. –

+0

도움을 주신 Tim Joe에게 감사드립니다.하지만 이미 게시 한 스 니펫에는 포함되지 않았으므로, 내가 작성한 방법을 보여주기 위해 질문을 편집했습니다. –

+0

다시 한번 고마워요.하지만 버튼 클릭이 작동하지 않습니다. 버튼이 말한대로 "계속"을 "확인"으로 변경했습니다. 윈도우가 다른 것으로 불리기 때문에 그것이 가능하다고 생각합니까? 추신 : 내 코드를 업데이트했습니다 –

2

흰 겹침판 감지기를 추적하여 설치했는지 확인할 수있었습니다. 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 
+0

해결책을 찾았지만 제대로 작동하지 않았습니다. 코드에서 어디에서 파일을 열었습니까? 나는 "시스템 이벤트에 말하기"전에 시스템 이벤트를 알려주지 만 끝내면 아무 것도 작동하지 않았다. –

+0

나중에 살펴 보겠습니다. 그 동안 파일 열기 명령을'응용 프로그램 응답 무시 '와'끝 무시'사이에 랩핑하고 얻은 결과를보고해볼 수 있습니까? –

+0

나는 그것을 시험해 보았고, 흰색 덧씌우 기 팝업을 멈추지 않지만 나중에 코드를 깨뜨릴 수있다. 이제 전체 코드를 작성합니다. –

관련 문제