Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari 3 beta, tab object and AppleScript



> At 1:30 AM +0200 6/13/07, jj wrote:
>> 
>> And now, a bit OFF-TOPIC, all my regular "do javascript" calls are broken.
>> Not only for the new AS syntax (no more "in document 1"), but for the "new"
>> JS syntax (old javascript is not working no more)...
> 
> Can you be more specific? What's "old javascript"?

Wait, I'll take a look to one now-not-working javascript...

##########################
set x to "x = document.getElementsByTagName('TD');

for(i=0;i<x.length;i++){
    if (x[i]['class'] == 'tip1' && x[i]['bgcolor'] == '#A3947D') {
        y = x[i].innerHTML;
        break;
    }
}

y
"
    
tell application "Safari"
    set rep to (do JavaScript x in current tab of first window)
end tell
##########################

This one is trying to locate and innerHTML the contents of a TD class="tip1"
and bgcolor="#A3947D". It worked before and it doesn't now.

So, I must replace now:

x[i]['class']

With:

x[i].getAttribute('class')

Most probably there are more cases, but now I don't have the time to check
it all ;-))


BTW, I think there is something wrong in Smile's dict windows with the new
core... Hmmm... Yes! Anchors won't work (the thing you click on the left
-ie, a command-name-). --> Smile 3.2.0b (build 341)

Cheers!


jj

* Maybe I was crying so loud when I said "***all*** my regular "do
javascript" calls are broken", I must check all my regular "do javascript"
calls before crying so loud ;-)
 
> Thanks,
> Emmanuel
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/applescript-users/email@hidden
> Archives: http://lists.apple.com/archives/applescript-users
> 
> This email sent to email@hidden

-- 
http://www.macscripter.net/
http://www.osaxen.com/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Safari 3 beta, tab object and AppleScript (From: Emmanuel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.