Re: Closing Safari Tab...
Re: Closing Safari Tab...
- Subject: Re: Closing Safari Tab...
- From: Christopher Stone <email@hidden>
- Date: Sat, 10 Dec 2011 16:36:10 -0600
On Dec 10, 2011, at 15:42, David Crowe wrote: I am having difficulty closing tabs in a Safari window with multiple tabs.
{snip} What I'd really like to do is close all tabs other than the current one. While I can do that through ctrl-clicking on the tab, automating it is another matter.
Thanks for any assistance. ______________________________________________________________________
Hey David,
Which Mac OS and which Safari?
Give this a try:
try tell application "Safari" tell front window if it's document ≠ missing value then set tabURL to URL of current tab close (every tab whose URL ≠ tabURL) end if end tell end tell on error errMsg number errNum set {cr, sep} to {return, "------------------------------------------"} set e to sep & cr & "Error: " & errMsg & cr & sep & cr & "Error Number: " & errNum & cr & sep beep display dialog e end try
-- Best Regards, Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden