• 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: copy url rom safari to firefox issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy url rom safari to firefox issue


  • Subject: Re: copy url rom safari to firefox issue
  • From: Christopher Stone <email@hidden>
  • Date: Mon, 21 Mar 2011 01:33:57 -0500

Hey Dave,

On Mar 20, 2011, at 12:57, DealTek wrote:
do shell script "open -a Firefox " & thisPage

That's handy even if rather kludgy.  Mozilla.org should at least give us a 'do _javascript_' function; their current Applescript implementation is nearly useless.

On Mar 20, 2011, at 10:43 AM, DealTek wrote:
tell application "Safari"
activate
set my_URL to the URL in document 1
end tell

You were close:

tell application "Safari"
if document 1 exists then
set pageURL to URL of document 1
end if
end tell

There's no need to 'activate' unless you genuinely want to bring Safari forward.

Not certain what you're trying to accomplish here:

--Convert Unicode Text of my_URL to Plain text
set my_URL to «class ktxt» of ((my_URL as string) as record)

'class ktxt' doesn't produce really plain text anymore (since Tiger?).

This is unfortunately useless:

tell application "Firefox"
activate
get URL my_URL
end tell

Look in Firefox's dictionary, and you will fail to find any such ability.

------------------------------------------------------------------------------------------------
on safariUrlToFirefox()
try
tell application "Safari"
if document 1 exists then
set pageURL to URL of document 1
pageURL -- Will error if page has no url.
do shell script "open -a Firefox " & quoted form of pageURL
else
error "NO DOCUMENT OPEN!"
end if
end tell
on error errMsg number errNum
set sep to "=============================="
set e to sep & return & "Error: " & errMsg & return & sep & return ¬
& "Error Number: " & errNum & return & sep
beep
display dialog e
end try
end safariUrlToFirefox
------------------------------------------------------------------------------------------------
safariUrlToFirefox()

--
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

  • Follow-Ups:
    • Re: copy url rom safari to firefox issue
      • From: DealTek <email@hidden>
    • Re: copy url rom safari to firefox issue
      • From: DealTek <email@hidden>
References: 
 >copy url rom safari to firefox issue (From: DealTek <email@hidden>)
 >Re: copy url rom safari to firefox issue (From: DealTek <email@hidden>)

  • Prev by Date: Re: Excel: hide multiple columns with Applescript
  • Next by Date: Re: Excel: hide multiple columns with Applescript
  • Previous by thread: Re: copy url rom safari to firefox issue
  • Next by thread: Re: copy url rom safari to firefox issue
  • Index(es):
    • Date
    • Thread