(This is what I have gathered from one of the posts in Macscripter: QS accept characters whose ASCII codes are 01 through 127. A string which contains a accented character doesn't work)
The script below replaces problematic characters with "?". tell application "System Events"set {name:theApp, bundle identifier:theIdentifier} to (get 1st application process whose frontmost is true)
end tell
tell application theApp
tell application "System Events"
tell process theApp
delay 0.2
click menu item "Copy" of menu 1 of menu bar item "Edit" of menu
bar 1
--alternatively, you can use:
--keystroke "c" using command down
end tell
end tell
end tell
delay 0.2
set cb to quoted form of (the clipboard as string)
do shell script "/bin/echo " & cb & " | /usr/bin/tr -c '[:print:]
[:cntrl:]' '?' | qs "
anytext.scpt
Description: Binary data
