Howdy,
I am trying to add some html help to an applescript studio application, and I want to create several “?” buttons in the UI that will bring the user to the relevant paragraph in the html file. I am trying to do this with the html “id” attribute, where a hash and a string are added to the end of the url. For example, pasting this file address in a browser:
/Users/tm/myfile.html#section1
will open myfile.html and scroll down to the area marked “section1”.
I am having trouble when I try to code this from applescript because the browser is replacing the hash mark with “%23”, and this destroys the address. Here is the applescript that I’m working with:
set pathtohome to path to home folder as string
set idString to "section1"
set theUrl to (POSIX path of pathtohome) & "myfile.html#" & idString
tell application "Safari"
open location theUrl
end tell
I have also tried converting theUrl to unicode text, and the browser still replaces the hash with %23. Any help you can provide would be greatly appreciated!
Tasha
Model: macbook core duo
AppleScript: Xcode v 3.0
Browser: Firefox 3.0.10
Operating System: Mac OS X (10.5)