• 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
Re: Scripting Additions Calls in Tell Blocks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Additions Calls in Tell Blocks


  • Subject: Re: Scripting Additions Calls in Tell Blocks
  • From: Michael Terry <email@hidden>
  • Date: Tue, 10 Feb 2004 00:47:01 -0800

On Feb 9, 2004, at 8:32 PM, Gary Lists wrote:

He goes on to describe the slow-down, with the command being dealt with
(unsuccessfully) by the targeted application and then being passed along
when no entry is found in the dictionary.

I should remember to always consult the bible before posting. Of course, even better would have been to look up the thread I thought I was responding to, and make sure it said what I thought it did.

When you think about it, there is really no need to tell _Safari_ to 'open
location', is there?


Well, I suppose you hadn't read my follow-up yet when you wrote this, or I wasn't as clear as I could have been. If you tell Safari to 'open location' then it always will regardless of the user's system preferences. The advantages for my purposes are:

1. Works with many (all?) browsers.
2. Allows you to use a term, 'current location', that doesn't depend on any particular browser being installed to compile. Resists 'locate application' dialogs.[1]
3. Reduces script's length and complexity.

Here's a script. Folks on OmniGroup's OmniWeb discussion list will have already seen it.

------------------------------------------------------------------------ ---
-- Open Current URL in Other Browser 1.0d3
------------------------------------------------------------------------ ---
property browserList : {"Safari", "Netscape", "Internet Explorer", "Camino"}

tell application "OmniWeb" to tell front browser
set theURL to get address
end tell

choose from list browserList with prompt "Open <" & theURL & "> in browser(s): " default items {"Safari"} with multiple selections allowed
tell result as list to repeat with i in it
if i's contents is false then return
my openURL(i, a reference to theURL)
end repeat

on openURL(appl, theURL)
tell application appl
activate
open location theURL
end tell
end openURL
------------------------------------------------------------------------ ---

Mike

[1] You can get around this by uploading a pre-compiled script somewhere, but I understand that it will still ask the user to locate the application when they run the script. I've been a little curious the last couple days whether this occurs only if the run path takes you through a missing app, or if it tries to locate every referenced app as soon as it starts running.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: Scripting Additions Calls in Tell Blocks (From: Gary Lists <email@hidden>)

  • Prev by Date: Re: Sed replace oneline nogo in Applescript
  • Next by Date: Re: Scripting Additions Calls in Tell Blocks
  • Previous by thread: Re: Scripting Additions Calls in Tell Blocks
  • Next by thread: RE: Scripting Additions Calls in Tell Blocks
  • Index(es):
    • Date
    • Thread