Safari front window url - appscript

1

12 34

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
 
M

Morton Goldberg

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.

<code>
require 'appscript'
include Appscript
require "jcode"

$KCODE = "UTF8"

url_1 = app('Safari').documents[1].URL.get
puts url_1
</code>

Note that I used 'URL' not 'url'.

Regards, Morton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,986
Latest member
ColbyG935

Latest Threads

Top