3

ジョブ フォルダの作成に使用する Applescript があります。Applescript は、プロジェクト名とフォルダーが保存される場所を要求します。ジョブ名とフォルダーの場所を入力すると、スクリプトはメイン フォルダーと 4 つのサブフォルダーを作成します。

ここで、現在のサブフォルダーの 1 つに番号付きのサブフォルダーを作成するスクリプトを作成し、作成するフォルダーの数をユーザーに尋ねるプロンプトを表示します。それは可能ですか?

tell application "Finder"
    set JobName to text returned of (display dialog "Please enter Job Name:" default answer "Job_Name")
    set loc to choose folder "Choose Parent Folder Location"
    set newfoldername to JobName
    set newfo to make new folder at loc with properties {name:newfoldername}
    make new folder at newfo with properties {name:"Job Materials"}
    make new folder at newfo with properties {name:"Previews"}
    make new folder at newfo with properties {name:"PSDs"}
    make new folder at newfo with properties {name:"VX"}
end tell
4

1 に答える 1

6
set JobName to text returned of (display dialog "Please enter Job Name:" default answer "Job_Name")
set loc to choose folder "Choose Parent Folder Location"

tell application "Finder"
    set newfo to make new folder at loc with properties {name:JobName}
    make new folder at newfo with properties {name:"Job Materials"}
    make new folder at newfo with properties {name:"Previews"}
    set targetFolder to make new folder at newfo with properties {name:"PSDs"}
    make new folder at newfo with properties {name:"VX"}
end tell

repeat
    set subCount to text returned of (display dialog "How many subfolders?" default answer 3)
    try
        if subCount ≠ "" then
            subCount as integer
            exit repeat
        end if
    end try
end repeat

repeat with i from 1 to subCount
    tell application "Finder" to make new folder at targetFolder with properties {name:"Subfolder " & i}
end repeat
于 2013-07-02T18:24:10.350 に答える