Jump to content

Refresh Safari Windows


Recommended Posts

I know that there are several refresh Safari tabs but what I would like to do 

is refresh 2 separate Safari Windows.

 

Have searched high and low and even tried creating the workflow but no success.

 

If someone could just point me to the work flow (I figure someone has built one)

that would be great. 

 

Link to comment

I know that there are several refresh Safari tabs but what I would like to do 

is refresh 2 separate Safari Windows.

 

Have searched high and low and even tried creating the workflow but no success.

 

If someone could just point me to the work flow (I figure someone has built one)

that would be great. 

 

Well that will be kinda tricky because your script would need to be smart enough to know which tab to refresh. A basic script to get started would be this..

tell application "Safari"
	set temp to the URL of tab 1 of window 1
	set URL of tab 1 of window 1 to temp
end tell

This would grab the url of the first tab in the first window and then set the url back to that, essentially doing a refresh

Link to comment

This seems to be what you're looking for. Specify the page titles (or first part of the page titles)  of the tabs you want to reload at the top in thePagesToRefresh.

 

It's easy enough to change to work on URLs instead of titles if that would work better for you.

set thePagesToRefresh to {"Google", "List of iOS Emoji"}

tell application "Safari"
	repeat with theName in thePagesToRefresh
		repeat with theTab in (every tab of every window whose name starts with theName)
			tell theTab
				set URL to URL
			end tell
		end repeat
	end repeat
end tell
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...