• 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: Changing Spelling Dictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing Spelling Dictionary?


  • Subject: Re: Changing Spelling Dictionary?
  • From: Harald E Brandt <email@hidden>
  • Date: Mon, 19 Apr 2004 19:19:24 +0200

On 2004-04-17, at 23.01, Emmanuel wrote:

At 10:21 PM +0200 17/04/04, Harald E Brandt wrote:
I just wonder if anyone has done any attempts at automating the change of Spelling Dictionary [in any general Cocoa text app that supports spell check].

I am just so very tired of the frequent (several times a day) change between Swedish <-> English, so I would really like to automate that thing by simply pressing a button or so. It's normally not a scriptable thing to do, but maybe someone has a gory trick at hand.... with or without extras such as iKey, QuicKeys, ...

Did you try XSpell.osax? (XSpell.osax is given a nice interface in Smile, including a personal dictionary)

No, actually, I did not try anything, since I assume others already have done exactly what I wanted, so why invent the wheel again... The mentioned osax only has two commands for checking/guessing a word -- nothing for changing dictionary.

I think I have observed it automatically switching language according to the language of the text it's checking.

I sincerely doubt!!
Most probably it was set to "multilingual", thus accepting things like this: "Vous haben eines tres kul dag today".

Anyway, Deivy P and I came up with a UI scripting "crutch" (crutch since it's not fully what we want)
It works from e.g Apple's Script Menu or iKey:

------------------------------------------------------------------------ ---------------------------------
tell application "Finder" to set x to get displayed name of (path to frontmost application)
set lista to {"English", "Svenska"} --only add the languages you are really interested in
tell application x to set mnu to choose from list lista with prompt "Pick dictionary:" without multiple selections allowed
--the 'tell app' is there only to ensure it is targeted the right app in case the script is run from e.g iKey, which otherwise would target Finder.
if mnu is not false then
set mnu to item 1 of mnu
tell application "System Events"
set frontmost of process x to true
tell process x
tell menu "Spelling" of menu item "Spelling" of menu "Edit" of menu bar 1 to click menu item "Spelling" --Note: an ellipsis after Spelling
tell window "Spelling"
click pop up button 1 of group 1
tell menu "OtherViews" of pop up button 1 of group 1 to click menu item mnu
click button "Button"
end tell
end tell
end tell
end if
------------------------------------------------------------------------ ---------------------------------

The big drawback with this is that it does not sense what the current setting is, so it can't just toggle (which is really what I wanted). We could not find out how to do that. Maybe someone knows how?

Maybe there is a more direct "Unixy" way of directly switching languages?

Regards,


____heb____________________
Harald E Brandt http://bragit.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Changing Spelling Dictionary?
      • From: email@hidden
References: 
 >Changing Spelling Dictionary? (From: Harald E Brandt <email@hidden>)
 >Re: Changing Spelling Dictionary? (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Convert long number to string
  • Next by Date: Determine the version of an application
  • Previous by thread: Re: Changing Spelling Dictionary?
  • Next by thread: Re: Changing Spelling Dictionary?
  • Index(es):
    • Date
    • Thread