Automator question - Safari

Discussion in 'Mac Programming' started by tthorne, May 24, 2010.

  1. tthorne macrumors newbie

    Joined:
    May 24, 2010
    #1
    I have a workflow set to grab my url's I want, then get the link url's from each page, then filter them keeping only the ones I want.

    I am wondering if there is a way to then have all those url's cycle one after another in one window, on one tab, instead of opening them all in many windows or tabs. Thanks.
     
  2. numero macrumors regular

    Joined:
    Jul 23, 2002
    Location:
    OR
    #2
    Here's some AppleScript that might do what you want. Maybe this will give you some ideas to solve what you are trying to do.

    Code:
    set urls to {"http://www.apple.com", "http://www.google.com"}
    
    tell application "Safari"
    	activate
    	make new document
    	repeat with aUrl in urls
    		set URL of front document to aUrl
    		delay 5
    	end repeat
    end tell
    -numero
     
  3. numero macrumors regular

    Joined:
    Jul 23, 2002
    Location:
    OR
    #3
    I worked on this a little more and came up with a final solution.

    Insert a "Run Applescript" action (from the Utilities section) and make the code to:

    Code:
    on run {input, parameters}
    	
    	(* Your script goes here *)
    	
    	tell application "Safari"
    		activate
    		make new document
    		repeat with aUrl in input
    			set URL of front document to aUrl
    			delay 5
    		end repeat
    	end tell
    	
    	--return input
    end run
    -numero
     

Share This Page