• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unable to send user input string to Webster Dictionary Application using variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Window Pen <email@hidden>
  • Date: Wed, 19 Aug 2009 19:06:45 +0700



                            Help......



  A  Result:

************


Nothing works passed by variable. The AppleScripts string encoded in Unicode is, ah... I can't figure out how to get Unicode text input into Mac Roman ASCII for Webster command. 


Only the string literals encapsulated in quotes function in Webster Dictionary   "aardvar" and "Brazil" 


  A   Script: 

************

check syntax

display dialog "Look up " default answer "" with title "Webster's"

set dialogInfo to text returned of the result

log dialogInfo


beep 1

tell application "Merriam-Webster"

activate

delay 5

MWClearPaste "aardvark"

MWClearPaste dialogInfo

end tell

beep 2

delay 2


tell application "Merriam-Webster"

activate

MWClearPaste "Brazil"

MWClearPaste dialogInfo

end tell


tell application "Merriam-Webster"

activate

MWClearPaste dialogInfo as string --<-------------- Geoff's 

log dialogInfo

end tell






A Event Log:

************

tell current application

check syntax current application

display dialog "Look up " default answer "" with title "Webster's"

{text returned:"robber", button returned:"OK"}

(*robber*)

beep 1

end tell

tell application "Merriam-Webster"

activate

MWClearPaste "aardvark"

MWClearPaste "robber"

end tell

tell current application

beep 2

end tell

tell application "Merriam-Webster"

activate

MWClearPaste "Brazil"

MWClearPaste "robber"

activate

MWClearPaste "robber"

(*robber*)

end tell



----------------------------------------


  B  Result:

************



using Shane's:


set answer to «class ktxt» of (answer as record)


If I set answer to dialogInfo the AppleScript Error at runtime is 

"Can't make "rabbit" into type record 


If I do not set answer to dialogInfo the Apple Script Editor will not compile the script: "The variable answer is not defined"



  B  Script: 

************


check syntax

display dialog "Look up " default answer "" with title "Webster's"

set dialogInfo to text returned of the result

tell application "Merriam-Webster"

activate

set answer to dialogInfo

set answer to «class ktxt» of (answer as record)

beep 1

MWClearPaste answer

end tell


B Event Log:

************


tell current application

check syntax current application

display dialog "Look up " default answer "" with title "Webster's"

{text returned:"rabbitone", button returned:"OK"}

(*rabbitone*)

beep 1

end tell

tell application "Merriam-Webster"

activate

current application

activate

MWClearPaste "rabbitone"

MWClearPaste "rabbittwo"

beep 1

«event ascrgdut»       <-------- what is that?

{}

beep 1

activate

MWClearPaste "rabbittthree"

MWClearPaste "rabbitone"

beep 2

end tell



 _______________________________________________
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

  • Follow-Ups:
    • Re: Unable to send user input string to Webster Dictionary Application using variable
      • From: Ed Stockly <email@hidden>
  • Prev by Date: Re: Find/replace
  • Next by Date: Re: Unable to send user input string to Webster Dictionary Application using variable
  • Previous by thread: Re: Unable to send user input string to Webster Dictionary Application using variable
  • Next by thread: Re: Unable to send user input string to Webster Dictionary Application using variable
  • Index(es):
    • Date
    • Thread