• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Safari 3 beta, tab object and AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari 3 beta, tab object and AppleScript


  • Subject: Re: Safari 3 beta, tab object and AppleScript
  • From: jj <email@hidden>
  • Date: Wed, 13 Jun 2007 13:39:45 +0200
  • Thread-topic: 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:
> 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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

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

  • Prev by Date: Re: Safari 3 beta, tab object and AppleScript
  • Next by Date: Re: Safari 3 beta, tab object and AppleScript
  • Previous by thread: Re: Safari 3 beta, tab object and AppleScript
  • Next by thread: Re: Safari 3 beta, tab object and AppleScript
  • Index(es):
    • Date
    • Thread