我在工作时升级 iMac 上的 applescript 时遇到问题,如下,停止于:
error number -1719 from text field 1 of window 1 of process "QuarkXPress"
我尝试运行的完整脚本:
try
tell application "FileMaker Pro Advanced"
--tell database "artdb_Client"
set theRecord to current record of database "artdb_Client"
tell theRecord
set theCustomer to item 4
set theCustomerName to item 5
set theFileName to item 2
end tell
--end tell
end tell
tell application "QuarkXPress"
activate
display dialog ¬
theCustomer & " - " & theCustomerName default answer theCustomer buttons {"Cancel", "OK"} default button 2 ¬
with title "Enter the Customer Code for Job"
(*
display dialog ¬
theCustomer & " - " & theCustomerName & ¬
"?" with title "Export PDF for Customer"
*)
end tell
set theFolder to "Data HD:Proofs:" & theCustomer
set theFolderOfPosix to "/volumes/Data HD/Proofs/" & theCustomer
set this_item to theFolder & ":" & theFileName & ".pdf"
set theProofsDir to "Data HD:Proofs:" as alias
tell application "System Events"
tell process "QuarkXPress"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
tell menu item "Export"
tell menu "Export"
click menu item "Layout as PDF..."
delay 1
end tell
end tell
end tell
end tell
end tell
end tell
repeat 5 times
tell process "QuarkXPress"
if window "Export as PDF" exists then
keystroke "G" using command down
set value of text field 1 of window 1 to theFolderOfPosix & "/"
keystroke return
click button "Go" of window 1
exit repeat
else
delay 1
end if
end tell
delay 1
end repeat
end tell
end try
最佳答案
我终于让它工作了,脚本停止了(没有放入调用的数据):
将窗口 1 的文本字段 1 的值设置为 theFolderOfPosix &“/”
我把它改为:
将窗口 2 的工作表 1 的文本字段 1 的值设置为 theFolderOfPosix & "/"
感谢 UI 浏览器向我展示了我丢失的“工作表”字段,它看起来不正确,但它完成了工作,所以我想这就是最重要的。
关于Applescript 改变了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30204596/