Applescript 改变了?

标签 applescript

我在工作时升级 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/

相关文章:

macos - AppleEvent 处理程序失败 (-10000)

macos - 从 shell 打开终端并执行命令

Python 使用 osascript 将文件路径变量传递到 Applescript

applescript - 如何在applescript中创建记录列表

python - 在可编写脚本的应用程序中使用 Python(在 Mac 上)

Java - AppleScript 的执行抛出 NullPointerException

macos - 如何在 OS X 中使用 osascript 或 AppleScript 显示模态窗口

automation - 如何在预定时间运行applescript

macos - 如何在 Mac OS X 上打开 Emacs 以便它加载我的 $PATH?

applescript - Applescript 中的击键 Fn(功能)键