• 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
[REQ] Strange char "?" in html source from Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[REQ] Strange char "?" in html source from Safari


  • Subject: [REQ] Strange char "?" in html source from Safari
  • From: Marco Trotta <email@hidden>
  • Date: Wed, 25 Jul 2007 10:41:45 +0200

Hi,
i'm an applescript user. i'm having a trouble with html source from
safari
i've wrote a script in order to identify and copy text from html
source.

but there is a trouble with source coming from this kind of site:
http://www.lastampa.it/redazione/cmsSezioni/economia/200707articoli/24000girata.asp

When i try to get text from html, the "'" become "?"
Example

  tell application "Safari" to copy (source of front document) to testo
  set dadove to (matchPos of (find text "<div class='articologirata'>" in
testo)) + 29
  set findove to matchPos of (find text "</div>" in testo starting at dadove)
  set body to (extract string testo from dadove to findove)


If i'm try this

  tell application "Safari" to copy (source of front document) to testo
  set x to (offset of "accordo di fusione" in testo) - 1
  -- look in html rendering "l'accordo di fusione"
  get character x of testo

the result is "í"

but if If i'm try this

  tell application "Safari" to copy (source of front document) to testo
  set x to (offset of "accordo di fusione" in testo) - 1
  -- look in html rendering "l'accordo di fusione"
  get ASCII number (character x of testo)


the result is "63", the ascii decimal number fo "?"

I think is a trouble of windows char coding. but i do not know how
solve it.

i'm using mac os 10.3.9

could you help me?

thanks. mt
 _______________________________________________
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

  • Prev by Date: Re: script adding the script menu to the menu bar
  • Next by Date: Filemaker: referring to a "mirror" cell value
  • Previous by thread: Re: AppleScript-Users Digest, Vol 4, Issue 342
  • Next by thread: Filemaker: referring to a "mirror" cell value
  • Index(es):
    • Date
    • Thread