需要Applescript的UI结果并询问选择?
我已经创建了一个AppleScript,它的功能是在我想要的地方创建一个文件夹,然后在此文件夹中放置许多空文本文件 我想知道如何在执行此脚本结束时,出现一个窗口,说明脚本执行正确,并询问我是否希望用一个简单的按钮在Finder中显示文件夹 我的剧本:需要Applescript的UI结果并询问选择?,applescript,Applescript,我已经创建了一个AppleScript,它的功能是在我想要的地方创建一个文件夹,然后在此文件夹中放置许多空文本文件 我想知道如何在执行此脚本结束时,出现一个窗口,说明脚本执行正确,并询问我是否希望用一个简单的按钮在Finder中显示文件夹 我的剧本: set folderName to text returned of (display dialog "Please enter the folder name:" default answer "Folder_Name") set loc to
set folderName to text returned of (display dialog "Please enter the folder name:" default answer "Folder_Name")
set loc to choose folder "Choose Parent Folder Location"
tell application "Finder"
set newfolder to make new folder at loc with properties {name:folderName}
make new file at newfolder with properties {name:"fileA.txt"}
make new file at newfolder with properties {name:"fileB.txt"}
make new file at newfolder with properties {name:"fileC.txt"}
end tell
有可能吗
所以,如果可能的话,你能帮我吗?非常感谢!很好!是否可以在此警报弹出窗口中添加新行?把信息写在两行上?
set folderName to text returned of (display dialog "Please enter the folder name:" default answer "Folder_Name")
set loc to choose folder "Choose Parent Folder Location"
try
tell application "Finder"
set newfolder to make new folder at loc with properties {name:folderName}
make new file at newfolder with properties {name:"fileA.txt"}
make new file at newfolder with properties {name:"fileB.txt"}
make new file at newfolder with properties {name:"fileC.txt"}
end tell
display dialog "Script executed correctly. Reveal Folder" buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel"
if button returned of the result = "OK" then
tell application "Finder"
reveal newfolder
activate
end tell
end if
end try