• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Ever wanted to close a tab in Safari by Applescript? Here's how.. sometimes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: path to as string
  • Next by Date: Re: How to open link in default browser?
  • Previous by thread: Re: path to as string
  • Next by thread: Re: How to open link in default browser?
  • Index(es):
    • Date
    • Thread