REV, Applescript, Javascript technique

Phil Davis davis.phil at comcast.net
Sun Mar 12 17:03:23 EST 2006


Jim -

Shot in the dark: Do your Safari browser settings allow the applescript 
to work as intended? Or are there some OS settings that prevent things 
from working right?

Thanks -
Phil Davis


Jim Ault wrote:
> 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 = window.open('','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
> --or--
> Now on Tiger 10.4.2 with both Safari Version 1.3.1 (312.3.1) & Version 2.0
> (412.2)
> 
> 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 = window.open('','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
> pain.
> 
> Jim Ault
> Las Vegas




More information about the use-livecode mailing list