1

これは私の最初の Applescript です。リストに追加の要素がなくなったときに次のステップに進むループを使用して、できるだけ多くの項目を説明できるようにしたいと考えています。私のバージョンでは、現在 2 つのテキスト項目しか考慮されていません。前もって感謝します!

set userone to text returned of (display dialog "Job IDs Please" default answer "" buttons {"Submit", "Cancel"} default button 1)

set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to " "
set urllist to every text item of userone

set joburl to "http://crowdflower.com/jobs/"
set urlcrowds to urllist
copy urllist to urlcrowds
set item 1 of urlcrowds to joburl & 1st item of urllist
set item 2 of urlcrowds to joburl & 2nd item of urllist

get urlcrowds

tell application "Google Chrome"

activate

make new window

set myTab to make new tab at end of tabs of window 1

set URL of myTab to item 1 of urlcrowds

set myTab to make new tab at end of tabs of window 1

set URL of myTab to item 2 of urlcrowds

close tab 1 of window 1

end tell

どうもありがとう!

4

1 に答える 1

0

ループで繰り返しを使用できます。

set l to {12379081, 3785788, 3351991}
tell application "Google Chrome" to tell (make new window)
    repeat with i in l
        set u to "http://crowdflower.com/jobs/" & i
        make new tab at end of tabs with properties {URL:u}
    end repeat
    close tab 1
end tell

AppleScript 言語ガイド: コントロール ステートメントのリファレンスを参照してください。

open location新しいタブ ページを開きません:

repeat with i in words of "12379081 3785788 3351991"
    open location "http://crowdflower.com/jobs/" & i
end repeat

ターミナルで次のようなものを実行することもできます。

open http://crowdflower.com/jobs/{12379081,3785788,3351991} -a Google\ Chrome
于 2013-05-22T00:05:13.457 に答える