Keystroke a degree º Symbol

How can you Keystroke the degree "º" symbol
this does not work

tell application "TextEdit"
activate
make new document
end tell
tell application "System Events"
tell process "TextEdit"
keystroke "8"
keystroke "0" using option down
end tell
end tell

it is getting the zero from the 10 key pad and not the "0 / )" key

Thanks
darock

PM G4, Mac OS X (10.4.5)

Posted on Mar 31, 2006 6:23 PM

Reply
4 replies

Mar 31, 2006 8:44 PM in response to darock

Technically, neither option-0 or option-K are the degree symbol (option-o is technically 'masculine ordinal indicator' an option-k is 'ring above, as in å).

The correct character for the degree symbol is option-shift-8. However, neither 'keystroke "8" using {option down, shift down}', nor 'keystroke "*" using option down' has the desired result.

The only solution I've found is to use the key code command rather than the keystroke, and this seems to work:

tell application "TextEdit" to activate
delay 1
tell application "System Events"
tell process "TextEdit"
keystroke "8"
key code 28 using {option down, shift down}
end tell
end tell


I can't explain why keystroke "8" using {option down, shift down} doesn't work, though.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Keystroke a degree º Symbol

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.