Anyone know how to make a forward quote? (Like this: ’)
I’m needing to include a line of Javascript in my code, and ASS is converting the quote into another weird character.
Anyone know how to make a forward quote? (Like this: ’)
I’m needing to include a line of Javascript in my code, and ASS is converting the quote into another weird character.
Hmm. You might try posting your script here… because I see no issue with the ’ character. If not, you might want to be more specific as to what the weird character value is. There’s probably a way to bypass that, but it certainly isn’t AppleScript’s fault. I can understand why something like:
tell app "Safari"
do javascript "document.write "This is a test"" -- would error because you're escaping your applescript's quote.
end tell
but I wouldn’t think a single quote (') would do any harm.
And to prove Script Editor works with single quotes ('), I ran this script:
say "I am testing the 'quote' character"
It works
So, I think you need to post a) The weird character, and b) Partial if not all of the script
I got to run, busy with my Cocoa-based app. It does something very cool for AppleScript, I guess.
~ ashanks
Hei, hei… What is this? Please, ellaborate… :evil:
ashanks, he clearly requested help with the ( ’ ) character not the ( ’ ) character. It is called a “right single quotation”, and is not the same as an apostrophe. It is created manually by pressing option+shift+}.
Just to clarify, benlong…I can’t really think of an application where you would need to use an rsquot in javascript. Are you using it to pass a string via JS? Javascript’s single-quoting character is the apostrophe, not the rsquot. It would be pretty helpful, if not just for curiousity’s sake, to see why you have to use this character in your javascript.
Depending on how you plan to implement the character, there are a few ways to get applescript to display it. If you’re using applescript programmatically to type it, then you could use…
set rightSingleQuote to (ASCII character 213)
If you want to include it in some html code that you’re generating, then you could use something like…
set rightSingleQuote to "’"
set myHTMLString to ("<p>Here is my " & rightSingleQuote & " symbol</p>") as string
I too would like to see the code you’re using and why you’re using the ’ character. As ashanks said, perhaps knowing knowing what the code is and what the character it’s being switched to is, we could better understand what’s going wrong.
j
I’ve got an Applescript that’s building an HTML page. It’s creating a link that calls a Javascript routine, and the link needs to look like:
href="#"onClick=“launchwin(‘http://www.completedigitalphotography.com/galleries/testing/DSC00475.html’)”
If I use a single quote (as in the example here) it doesn’t work. When I’ve built these pages by hand, I’ve always had to use a forward quote. I don’t really know any Javascript to speak of, so if there’s a better way to do this, I’m all ears!
Never mind. Don’t know why, but it’s now working.