Open Location without actually opening Safari

I have this script here:

	set entered_ping_google_url to contents of text field "tf_ping_google_path" of tab view item "tvi_ping_google" of tab view "tv_ping_google" of window "window"
	set the_url to "http://www.google.com/webmasters/sitemaps/ping?sitemap=http://" & entered_ping_google_url & "/sitemap.xml"
	
	open location the_url

it basically pings google that a sitemap has been updated.

the script is totally fine, but instead of actually opening safari and opening the page, can i just set it to “run” the page without opening safari. is that possible?

thanks

Servus,

I’m not sure, whether this works, but try curl


set entered_ping_google_url to contents of text field "tf_ping_google_path" of tab view item "tvi_ping_google" of tab view "tv_ping_google" of window "window"
set the_url to "http://www.google.com/webmasters/sitemaps/ping?sitemap=http://" & entered_ping_google_url & "/sitemap.xml"

do shell script "curl " & the_url

servus - ich krieg hier irgendie das hier dann das ganze html von der seite. ich weiß nicht ob das so seien soll… lol

i said that i get the whole html of the page. if i look at a stats, the visitor, which should be my IP does not show up.

lol sry

and more ideas?

max

What StefanK suggested (almost) sends the proper request to Google. Getting back the HTML shouldn’t be a problem - you don’t have to do anything with it.

There’s a problem, though, when you use do shell script, you need to escape strings like URLs, especially if they have certain characters (like ampersand, quotes, question marks, and many others). So the code you need to use is:

do shell script "curl " & quoted form of the_url

That will properly escape the string - don’t try to put quotes around it yourself - use AppleScript’s built-in function quoted form of, as in my code above.

Browser: Safari 522) OmniWeb/v612.0.92598
Operating System: Mac OS X (10.4)

i will give that another try and let you know :smiley:

thanks