Safari front window url - appscript

Should be simple:

require ‘rubygems’
require ‘appscript’
include Appscript
urlFront = app(‘Safari’).documents[1].url.get
puts urlFront

but doesn’t work. In place of documents, I’ve tried window(s) too.

Thanks

On Jul 14, 2007, at 10:51 , 12 34 wrote:

Should be simple:

require ‘rubygems’
require ‘appscript’
include Appscript
urlFront = app(‘Safari’).documents[1].url.get
puts urlFront

ruby is case sensitive, so is applescript. You probably also want 0,
not 1.

Appscript.app(‘Safari’).documents[0].URL.get

really annoying warnings removed… why don’t more people develop

with -w??
=> “Parked at Loopia

On Jul 14, 2007, at 1:51 PM, 12 34 wrote:

Should be simple:

require ‘rubygems’
require ‘appscript’
include Appscript
urlFront = app(‘Safari’).documents[1].url.get
puts urlFront

but doesn’t work. In place of documents, I’ve tried window(s) too.

The following worked for me.

require 'appscript' include Appscript require "jcode"

$KCODE = “UTF8”

url_1 = app(‘Safari’).documents[1].URL.get
puts url_1

Note that I used ‘URL’ not ‘url’.

Regards, Morton