Ever wanted to close a tab in Safari by Applescript? Here's how.. sometimes
Ever wanted to close a tab in Safari by Applescript? Here's how.. sometimes
- Subject: Ever wanted to close a tab in Safari by Applescript? Here's how.. sometimes
- From: "Charles Arthur, UKClimbing Editor" <email@hidden>
- Date: Fri, 1 Jul 2005 12:05:45 +0100
A search suggests nobody has come across this..
Of course we know that there's no separate command in Applescript to close
the current tab.
Fraser Speirs seems to have hit on an answer, which works for him (and for
me, sometimes). His post is at
http://www.livejournal.com/users/fraserspeirs/905049.html but I'll post it
here...
tell application "Safari" to do JavaScript "window.close()" in front document
In my own tests, this *sometimes* works to close the current tab. No idea
why it works for him but not me, nor what the criteria are for working/not
working.
Still, it gets one closer to the nirvana of scripting tabs.
Charles
--
http://www.ukclimbing.com : 1,000+ British crags, 350+ British climbing walls
- searchable by distance rock type, etc, with 5-day weather forecasts for
every one - plus maps, articles, news, and the New Routes database. There's
even a cool shop attached...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden