osx - If next item exists in list, then applescript -


this first applescript. want able account many items possible using loop move on next step when there no more additional elements in list. version accounts 2 text items. thank in advance!

set userone text returned of (display dialog "job ids please" default answer "" buttons {"submit", "cancel"} default button 1)  set olddelimiters applescript's text item delimiters set applescript's text item delimiters " " set urllist every text item of userone  set joburl "http://crowdflower.com/jobs/" set urlcrowds urllist copy urllist urlcrowds set item 1 of urlcrowds joburl & 1st item of urllist set item 2 of urlcrowds joburl & 2nd item of urllist  urlcrowds  tell application "google chrome"  activate  make new window  set mytab make new tab @ end of tabs of window 1  set url of mytab item 1 of urlcrowds  set mytab make new tab @ end of tabs of window 1  set url of mytab item 2 of urlcrowds  close tab 1 of window 1  end tell 

thank much!

you can use repeat loop:

set l {12379081, 3785788, 3351991} tell application "google chrome" tell (make new window)     repeat in l         set u "http://crowdflower.com/jobs/" &         make new tab @ end of tabs properties {url:u}     end repeat     close tab 1 end tell 

see applescript language guide: control statements reference.

open location doesn't open new tab page:

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

you run in terminal:

open http://crowdflower.com/jobs/{12379081,3785788,3351991} -a google\ chrome 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -