为许多applescript'创建选择器UI;s

为许多applescript'创建选择器UI;s,applescript,Applescript,我是AppleScript的新手,我想为许多AppleScript创建一个UI选择器 例如,我有testA.scpt、testB.scpt、testC.scpt,我只想通过从窗口(UI)中的选项列表中进行选择来运行其中一个脚本 有可能吗 所以,这是可能的,你能帮我举个例子吗 我认为这是一个非常相似的代码,但我不确定: set theName to (choose from list {"testA", "testB", "testC"}) if theName is false then

我是AppleScript的新手,我想为许多AppleScript创建一个UI选择器

例如,我有testA.scpt、testB.scpt、testC.scpt,我只想通过从窗口(UI)中的选项列表中进行选择来运行其中一个脚本

有可能吗

所以,这是可能的,你能帮我举个例子吗

我认为这是一个非常相似的代码,但我不确定:

set theName to (choose from list {"testA", "testB", "testC"})
if theName is false then
    display dialog "You clicked cancel to exit." with icon stop buttons {"Exit"} default button {"Exit"}
else
    set theName to (item 1 of theName)
    display dialog theName with icon note buttons {"Info"} default button {"Info"}
end if

试试这个。它基于您的脚本与此脚本位于同一目录中

set theName to (choose from list {"testA", "testB", "testC"})

if theName is false then
    display dialog "You clicked cancel to exit." with icon stop buttons {"Exit"} default button {"Exit"}
else
    set theName to (item 1 of theName)

    tell application "Finder"
        set the_script_path to ((container of the (path to me)) as text) & theName & ".scpt"
        set the_script to load script alias the_script_path
    end tell

    run script the_script       
end if

试试这个。它基于您的脚本与此脚本位于同一目录中

set theName to (choose from list {"testA", "testB", "testC"})

if theName is false then
    display dialog "You clicked cancel to exit." with icon stop buttons {"Exit"} default button {"Exit"}
else
    set theName to (item 1 of theName)

    tell application "Finder"
        set the_script_path to ((container of the (path to me)) as text) & theName & ".scpt"
        set the_script to load script alias the_script_path
    end tell

    run script the_script       
end if