1

スタジオを通過する作品のクライアント プロジェクト フォルダーを作成するために、単純な Applescript 関数を使用します。

これは、約 7 年ほど前から導入され、完全に機能している、実績のある信頼できるスクリプトです。

何らかの理由で、スクリプトが突然動作を停止したようで、最終フォルダー階層内にジョブ番号が含まれません。ジョブ番号はありませんが、内部に正しいフォルダー構造を持つ「OK OK」というフォルダーが作成されるようになりました。

私は文字通りすべてを試しましたが、今は重い心と疲れた脳で助けを求めています!

これは私の現在のスクリプトです:

tell application "Finder"
    activate

    set the jobnumber to "[jobnum] "
    set the jobtitle to "[jobtitle] "


    repeat
        display dialog "Enter the job number:" default answer the jobnumber buttons {"Cancel", "OK"} default button 2
        copy the result as list to {the jobnumber, the button_pressed}
        if the jobnumber is not "" then exit repeat
    end repeat


    repeat
        display dialog "Enter the job title:" default answer the jobtitle buttons {"Cancel", "OK"} default button 2
        copy the result as list to {the jobtitle, the button_pressed}
        if the jobtitle is not "" then exit repeat
    end repeat

    set the jobtitle to jobnumber & " " & jobtitle

    set deskpath to desktop

    make new folder at deskpath with properties {name:jobtitle}
    make new folder at folder jobtitle of deskpath with properties {name:jobnumber & " Admin"}
    make new folder at folder jobtitle of deskpath with properties {name:jobnumber & " Final Artwork"}
    make new folder at folder jobtitle of deskpath with properties {name:jobnumber & " Links"}
    make new folder at folder jobtitle of deskpath with properties {name:jobnumber & " PDFs"}
    make new folder at folder jobtitle of deskpath with properties {name:jobnumber & " Resources"}
    make new folder at folder jobtitle of deskpath with properties {name:jobnumber & " Visuals"}

    make new folder at folder (jobnumber & " PDFs") of folder jobtitle of deskpath with properties {name:jobnumber & " Old PDFs"}

    make new folder at folder (jobnumber & " Admin") of folder jobtitle of deskpath with properties {name:jobnumber & " Supplier Estimates"}

    make new folder at folder (jobnumber & " Links") of folder jobtitle of deskpath with properties {name:jobnumber & " Workings & Resources"}

    make new folder at folder (jobnumber & " Visuals") of folder jobtitle of deskpath with properties {name:jobnumber & " Visual Links"}

    make new folder at folder (jobnumber & " Resources") of folder jobtitle of deskpath with properties {name:jobnumber & " Supplied Files"}

end tell

なぜこれが単に機能しなくなったのか、またはこれを修正する方法についてガイダンスを提供してくれるほど親切な人がいれば、私は非常に感謝しています!

それが完全に新しいスクリプトであるかどうかは気にしません...もう一度機能する必要があるだけです!

よろしくお願いします。

マット

4

2 に答える 2

0

基本的に、Darrick Herwehe が述べたように、ダイアログ ボックスの結果は、最初にボタンが返され、次にテキストが返されます。したがって、変数は、あなたが考えているものとは反対の結果を得ています。表示ダイアログの結果を取得する方法は次のとおりです。したがって、「結果をコピー...」行の代わりに、これを使用して、返された結果の順序を確認します。または、Darrick Herwehe が提案したように実行して、テキストのみを返すこともできます。

set {jobnumber, button_pressed} to {text returned, button returned} of result
于 2013-10-29T15:37:47.430 に答える