2013-07-08 41 views
0

我正在製作一個提示用戶從列表中選擇的小程序,而我的列表目前有169個項目。當列表生成時,窗口從顯示器的頂部延伸到底部,這對用戶來說有點壓倒性。在AppleScript中爲「從列表中選擇」設置邊界屬性?

我想知道是否有人知道如何編輯「從列表中選擇」生成的窗口的邊界屬性?

下面是我使用(不包括獨立的代碼編譯列表並將其存儲在「pkgList」)的代碼:

set userChoice to (choose from list pkgList with title "Title" with prompt "Choose file:" OK button name "OK" cancel button name "Cancel" without empty selection allowed) as string 

我很新的AppleScript,所以詳細的解釋和類比是非常感激。 :)

回答

0

您可以使用CocoaDialog代替:

set l to {"a a", "b"} 
set l2 to "" 
repeat with i in l 
    set l2 to l2 & quoted form of i & " " 
end repeat 

do shell script "/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog \\ 
standard-dropdown --title Title --text Text --items " & l2 
set {button, answer} to paragraphs of result 
if button is 1 then return 
item {answer + 1} of l 
+0

謝謝你的資源!我特別喜歡泡泡通知! :) – thankyour