Re: Unable to send user input string to Webster Dictionary Application using variable
Re: Unable to send user input string to Webster Dictionary Application using variable
- Subject: Re: Unable to send user input string to Webster Dictionary Application using variable
- From: Geoff Graham <email@hidden>
- Date: Tue, 18 Aug 2009 14:05:59 -0400
On Aug 18, 2009, at 12:36 PM, Window Pen wrote:
Thanks again Geoff.
Same problem, but your script is much more elegant than mine.
I think the literal works (example: "rabbit") because it bypasses
the OK prompt.
Could the OK button add an additional property to the text?
{text returned:"rabbit", button returned: "OK"}
Well, I don't think so, but if it did, casting it as a string would
insure that it is simply "text". But I am 99% sure that the text
returned from the dialog is equivalent to a literal text string you
define.
"text returned of" would seem to catch the literal string we want
from the "x" variable, but I'm not so sure. It think the set is
adding more with respect to the button returned: "OK". It may not
be able to be a string if it did, but there's a reason why the
webster's application is rejecting the input.)
Yes, although it doesn't have to be a good reason. At this point I
would play around with the order I call things, and what's
frontmost... You say thats the only command in the dictionary; I
assume it supports "activate", but maybe not. Try something silly:
set x to (text returned of (display dialog "Look up " default answer
"" with title "Webster's"))
Tell app "Finder" to open file "YourDiskName:Applications:Merriam-
Webster"
Tell app "Merriam-Webster" to MWClearPaste x
Even if that works, it's not exactly right, but it's a way to activate
an app without saying so. Also, you could try having the Finder
display your dialog. Messing around like this might help you get a
handle on things, like why it's being stubborn.
Is there a way to see with certainty what exactly the variable "x"
contains besides a display dialogue?
Yes, the script editor has that Result pane at the bottom. Comment out
the rest of your script and have it end on the step you want to analyze.
The MWClearPaste is the only command in the entire Webster's
applescript dictionary.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden