display dialog "Look up " default answer ""
set varUserEntry to text returned of result
set varLiteral to "literal"
tell application "Merriam-Webster"
MWClearPaste varUserEntry -- why does it not work?
MWClearPaste varLiteral -- works, but useless
end tell
Event Log
tell current application
display dialog "Look up " default answer “”
{text returned:“failure”, button returned:“OK”}
end tell
tell application “Merriam-Webster”
MWClearPaste “failure”
current application
MWClearPaste “failure”
MWClearPaste “literal”
end tell
[b]Using:[/b}
App is an old 2003 dictionary
Compiled in Script Editor 2.1.2 (82.1)
Model: MacBook
AppleScript: 1.10.7
Browser: Safari 531.9
Operating System: Mac OS X (10.4)
I’m not familiar with your app, but one possibility is the fact that with OS 10.4, your literal text is a string, whereas the text returned by ‘display dialog’ is Unicode text. Since your application is “old” (2003), it may not understand Unicode text. If that’s the problem, there’s a hack that’ll work in 10.4 to convert the Unicode text to a plain string. But if you upgrade to 10.5 ” where AppleScript uses Unicode text internally throughout ” you’ll also need to upgrade your app.
display dialog "Look up " default answer ""
set varUserEntry to text returned of result
set {text:varUserEntry} to (varUserEntry as string) -- Unicode text -> plain string hack.
set varLiteral to "literal"
tell application "Merriam-Webster"
MWClearPaste varUserEntry
MWClearPaste varLiteral
end tell
display dialog "Look up " default answer ""
set varUserEntry to text returned of result
set {text:varUserEntry} to (varUserEntry as string) -- Unicode text -> plain string hack.
tell application "Merriam-Webster"
MWClearPaste varUserEntry
end tell