REV, Applescript, Javascript technique

Jim Ault JimAultWins at
Sun Mar 12 05:16:38 EST 2006

Hope there is a simple answer to the following:

Using Rev to coordinate getting account info via the web.
Used to work, but not does not for some strange reason.
Rev sets the clipboard then calls...
tell application "Safari"
        set safariJavaCmdStr to the clipboard
        do JavaScript safariJavaCmdStr in document 1
end tell

Document 1 is the current web page frontmost.
The safariJavaCmdStr is the same code as the link on the web page that opens
a popup window when clicked to show detail.  Clicking works.

onclick=popup ='','detailPopup', 'scrollbars')....more code

When this window is showing, I tell Safari to...

set sorce to the source of the front document
then tell BBEdit to do some fancy RegEx to extract the essentials
then back to Rev to catalog and loop to the next popup window link.

This worked 6 months ago, OSX 10.3.9 Safari Version 1.3.1 (312.3.1)
Currently does not work on older G4, Panther 10.3.8, Rev 2.5.1
Now on Tiger 10.4.2 with both Safari Version 1.3.1 (312.3.1) & Version 2.0

Another test was.....
Sending the javaScript command directly from Script Editor (also fails with
no change or message in Safari)

This is the command (watch word wrap.. all one line)...
onclick=\"popup ='','detailPopup',
'scrollbars');popup.blur();document.TransactionListForm.gradeNumber.value =
91629973; document.TransactionListForm.ticketNumber.value = 0;
document.TransactionListForm.wagerNumber.value = 0;
document.TransactionListForm.submit(); return

I am not conversant in JavaScript, but understand enough try for a solution
if I had a few clues.  Is there another way to open a series of these
'detail popup' windows, get the source, close and do the next in a loop?

Why doesn't Applescript/Safari work with the do javaScript command?

Thanks for any guidance or help.  The manual method can work, but what a

Jim Ault
Las Vegas

More information about the Use-livecode mailing list