Selecting a spelling dictionary with AppleScript

I would like is to have several buttons on Mail's toolbar and have an Applescript attached to each that sets the spelling dictionary language. Can this be done?
Daniel

I don't know for the buttons, but here is a script that can set the language used in the spelling dictionary (at least with Mail 3.5 and Mac OS X 10.5.6). The script has been written for the French Canadian keyboard and could need some minor changes when used with other keyboards.
set L to "Français"
tell application "Mail"
activate
tell application "System Events"
tell application process "Mail"
set W to windows whose (subrole is "AXFloatingWindow" and (name contains "orthographe" or name contains "spelling"))
if W is {} then
keystroke ":" using command down -- with the French Canadian keyboard
set N to 1
click pop up button 1 of window N
click menu item L of menu 1 of pop up button 1 of window N
delay 1
click button 1 of window N
else
set W1 to item 1 of W
click pop up button 1 of W1
click menu item L of menu 1 of pop up button 1 of W1
end if
end tell
end tell
end tell

Similar Messages

  • Spelling dictionary:  where is the list of learned words?

    In MS Office all the technical words I have added to the spelling dictionary are stored in a simple text file. I now want to paste them into the Mac dictionary. Please can someone tell me if there is a text list of learned words and where it is stored.
    I will be really annoyed if I have to add each of the hundreds of words manually.
    Thanks,

    Again, I'm in Leo right now, but spent the last hour searching for it/them.. no soap.
    So I added some real long names to it, they showed up in en.
    I made a new file in Text Edit with these words...
    qwerty
    asdfgh
    zxcvbnm
    Changing one slightly to zxcvbnmkl and highlighting it in Text Edit, Right Click>Spelling & Grammer>Show Spelling & Grammer... it shows that zxcvbnmk is the proper spelling... en was not changed, as it was with the real long names!?
    zxcvbnmk does not exist in the content of any file, I have not found a Folder or File that was changed on those last three words!?
    I don't know how long of list you have, but a possible workaround...
    Load/paste them all into Text Edit, Select All>Right Click>Spelling & Grammer>Show Spelling & Grammer... Click Learn repetedly... I did a list of a hungred or so this way.
    Assuming Tiger has the same capability I'd guess.

  • Creating a Save As dialog box with Applescript for Excel 2008

    This is going to be part of a larger script. I'm trying to figure out how to make the default save location to where the file opened from and the default file name to the current filename in the dialog box.
    Here is what I go so far...
    tell application "Microsoft Excel"
    tell active workbook
    set myFile to choose file name with prompt "Save file as:"
    end tell
    end tell
    I'm very new with working with Applescript, so at this point I have been piecing together code snippets.
    Any help would be great and thank you

    The choose file name command supports a default location parameter that tells it where to open the dialog:
    set myFile to choose file name with prompt "Save file as:" default location (alias "Macintosh HD:Users:username:foldername:")
    So you need to look at the Excel dictionary to determine the path to the current file and insert it into the script. Every version of Excel has slightly different dictionaries so the version you're running is critical to getting the right syntax.

  • Export PDF Workflow with Applescript and CS3

    Hello,
    I am setting up some PDF workflow with Applescript.
    On a given moment, as my script runs and after getting some user-input answers to questions in some dialogs, my script tells InDesign CS3 to open the Export Adobe PDF window for the current document. I copied and pasted that small part of the script:
    tell application "Adobe InDesign CS3"
    tell document 1
    export format PDF type to "Macintosh_HD:Test01.pdf" using "somePreset" with showing options
    end tell
    end tell
    When you run this small part of my Applescript, InDesign opens the Export Adobe PDF window (as expected) waiting for me to click on "Export". That is exactly what I want, since the user is given here a last opportunity to change some values (for example page range, or spreads). When all is set, the user can click on Export to close the dialog and finish the script.
    Problem: I was hoping that the Adobe PDF Preset "somePreset" would be selected in the first pull-down menu of the Export Adobe PDF window when this window is opened by the script. Unfortunately the last used preset is always selected by default. Anyone suggestions or help?
    Kind regards,
    Bertus Bolknak.

    My operators enter the page range and filename into a dialog box. Then I set those in the script. I use the Press Quality preset to start with and then set the changes I want into a export variable. I set things like bleed, marks, page range, etc.
    Here is an example:
    set theProps to properties of PDF export preset "[Press Quality]"
    try
    delete PDF export preset "Schmidt PDF"
    end try
    set theStyle to {name:"Schmidt PDF", acrobat compatibility:acrobat 7, bleed top:"0.125i", bleed bottom:"0.125i", bleed inside:"0.125i", bleed outside:"0.125i", page marks offset:"0.125i", include ICC profiles:Include None, effective PDF destination profile:use no profile, effective PDF X profile:"No Color Conversion"} & theProps
    make PDF export preset with properties theStyle
    set properties of PDF export preferences to theStyle
    set color bitmap sampling of PDF export preferences to none
    set grayscale bitmap sampling of PDF export preferences to none
    set page range of PDF export preferences to (item i of myPageList) as string
    export document 1 format PDF type to (PrinergyFolder & myJobNumFinal & "_" & VerCode & ".pdf") as Unicode text without showing options
    I am also doing this in Quark.

  • Pages 09 won't let me change spelling dictionary from French to English!

    Pages 09 won't let me change spelling dictionary from French to English!
    I'm writing a syllabus for class and the spellcheck is stuck in French - for the life of me I can't change it.  The dictionary menu doesn't show up ANYWHERE.  Is this a bug?  is there a fix?

    tohubohu wrote:
      The dictionary menu doesn't show up ANYWHERE. 
    You really don't see Inspector > Text > More > Language with a choice of dictionaries?

  • Edit Illustrator symbol with AppleScript

    Hello,
    Does anyone know if it is possible to edit an existing symbol in an Illustrator CS3 document with AppleScript? Specifically, what I'm trying to do is this: I'd like to manually create an Illustrator document that uses the "3D Extrude and Bevel" effect to map symbols to the surfaces of the 3D object. Then, I'd like to programatically open that Illustrator document, edit the existing symbols (so the surfaces of the 3D object are updated), and finally export an image.
    From what I've found in the AppleScript documentation PDF, I'm thinking this is not possible since it lists all the properties of a symbol object as read-only. But perhaps I'm overlooking something?
    If it is not possible, is there another way of doing what I'm trying to achieve?
    Thanks!
    Ben

    Ben, could you not have just swapped your symbols? like:
    set symbol of every symbol item to symbol "Foo"
    Justin, if it is essential that you need to crack open a symbol item then it may be possible using system events to expand the item may even be possible with a action for this part?
    This works for me. It is set to work with what items i know are available to my test doc.
    {1 symbol of >2 path items, 2 gradients swatches}
    tell application "Adobe Illustrator"
    activate
    set Doc_Ref to the current document
    tell Doc_Ref
    set x to width / 2
    set y to height / 2
    set ruler origin to {x, y}
    -- Make new layer to trash later
    make new layer at beginning with properties ¬
    {name:"Opened Symbol", visible:true}
    -- Place the symbol item you want to open
    make new symbol item at beginning of layer "Opened Symbol" with properties ¬
    {symbol:symbol 1, position:{0, 0}}
    -- Select the item
    set selection to symbol item 1
    -- Use system events to drive the GUI
    tell application "System Events"
    tell process "Adobe Illustrator"
    tell menu bar 1
    click menu item "Expand..." of menu "Object"
    delay 0.1
    keystroke return
    delay 0.1
    click menu item "Ungroup" of menu "Object"
    end tell
    end tell
    end tell
    -- List your items to edit
    set Symbol_Items to every page item of layer "Opened Symbol"
    -- Edit what ever you have here
    set fill color of path item 1 of layer "Opened Symbol" to {gradient:gradient 1}
    set fill color of path item 2 of layer "Opened Symbol" to {gradient:gradient 2}
    -- New group
    set New_Group to make new group item at beginning of layer "Opened Symbol"
    -- Move edited items into new group
    repeat with i from (count of Symbol_Items) to 1 by -1
    move (item i of Symbol_Items) to beginning of New_Group
    end repeat
    -- New symbol from group
    make new symbol at end with properties ¬
    {name:"My New Symbol", source art:New_Group}
    -- Replace instances
    set symbol of every symbol item to symbol "My New Symbol"
    -- Clean up
    delete every page item of layer "Opened Symbol"
    delete layer named "Opened Symbol"
    delete symbol 1
    end tell
    end tell

  • How to set the transition duration of a slide in keynote with applescript

    hi
    how to set the transition duration of a slide in keynote with applescript
    i made an applescript script which converts a numbers file to a keynote presentation
    figured out how to set the transitions but cant find how to set the time
    +set appTransition of slideTransition of current slide to "apple:dissolve"+
    anyone?

    you can send keystrokes to invoke menu commands via shortcuts but as for transition time not sure. You've check the dictionary right? Scripting support is very limited in KN.

  • Apply Fill Color to Group Item with Applescript

    Is it possible to set the fill color of a group item using applescript and CS3? The group contains paths and text that have the same fill color with no strokes.I am able to select the group and delete it or move it (with applescript) but have had no success in setting the fill color.
    Thank you in advance for help on this question. And thanks for everything I have picked up from browsing.

    Now that I am addressing the path items and text items of the group separately I am having some success. Now I am having difficulty getting the correct terms for assigning a Spot Color to the file. Here is a piece of the script.
    This works:
    tell application "Adobe Illustrator"
    set openDoc to document 1
    set ftClr1 to (first group item whose note is "Front3") of openDoc
    set ftClr1Paths to path items of ftClr1
    repeat with thisPath in ftClr1Paths
    set fill color of thisPath to {red:255}
    end repeat
    set textFrames to text frames of ftClr1
    repeat with thistext in textFrames
    set fill color of every line of thistext to {red:255}
    end repeat
    end tell
    Need help to set the fill color to a Spot Color that already exists in Swatches.
    Thanks
    Nick

  • Safari on Windows. How does one change default spelling dictionary?

    How does one change the default spelling dictionary for Safari on Windows? For the Mac, it changes in response to the default locale, but on Windows, it just sets to American English and you cannot change it anywhere I can see. All my locale information in Windows is set to UK English.
    In fact on some websites, like this one, the spelling checker seems to be disabled! I'm on Windows 7 64-bit, BTW, running Safari 5.1.7
    Message was edited by: Grant Wray

    I think I just found the answer (though I don't know why the interface is buried this way). Find a word that the American spell check is flagging, right click on it, select Spelling and Grammar, and then select Show Spelling and Grammar. Make sure that the language listed at the bottom says British English (not my choice of what to call it, so please don't blame the messenger).

  • Version 31.0 refuses to install spelling dictionary

    New installs or profiles of Firefox 31.0 refuse to install the spelling dictionary Nederlands with: "Not available for Firefox 31.0", which is silly because the dictionary in question is working just fine in existing versions of Firefox (where this spelling dictionary was installed earlier) that have been updated to 31.0 .
    How do I get Firefox to install the dictionary anyway/? I have this problem with a new install on my laptop (Ubuntu Linux) and a new profile on my PC (Slackware Linux).

    Just click that grayed "Add to Firefox" button and click "Install Anyway".

  • Activate / open the address book with applescript

    Hi,
    I try to open the address book and select a vCard with AppleScript.
    If the address book is closed I can achieve this (open / activate the address book) with:
    tell application "Address Book"
    try
    activate
         end try
    end tell
    If the address book is hidden (command+H) I can use:
    tell application "System Events" to set visible of process "Address Book" to true
    However if the address book is closed (command+W) neither of these commands are able to put the address book to the front.
    How can I activate the address book (make it visible and front) in this case?

    Hi,
    Try this:
    tell application "Address Book"
      activate
              set visible of item -1 of windows to true
    end tell
    Best wishes
    John M

  • Move and/or Re-Size Opacity Mask with AppleScript

    apologies if this is regarded as a dual post. I saw a thread about this but it only related to JavaScript.
    Anyway, I cannot seem to re-scale or move the Opacity Mask of an object with Applescript. The vector item will behave just as it should, but the Opacity Mask will remain in place. As you can imagine, I have tried all manner of solutions, from trying to select raster items to move with transforming, etc. and nothing has worked. Any suggestions would be greatly appreciated.

    I see...it seems to be a bug, the actual mask gets ignored. Probably to be consistent with the user interface, you can not select the mask with the mouse either.
    maybe someone else has found a way to work with Opacity Masks, I haven't.
    as a side note, there's no need to select the objects in order to size them or move them, you can just reference them. Also, there's no "Selected" object, change that to "selection".

  • Problems with AppleScript and MS Office 2011

    The script below used to work great for converting MS Word files to PDF files.  However, sometime during the last few months it has stopped working and will no longer compile without error.  Possibly after upgrading to Mavericks but I'm not exactly sure when it stopped working, could have been an update to Office.  Anyway, the error I'm getting when I compile is a Syntax Error, "Expected end of line but found class name".  The editor highlights "document" in the line "set the_doc to active document".  I'm not very familiar with Applescript but I have opened the scripting dictionary for Microsoft Word in the Applescript editor and I do see "active document" as a property of the "document" object.  So why doesn't the compiler recognize it?  Am I missing something obvious or was there some sort of change in Mavericks that broke this functionality?
    I've been pulling my hair out trying to get this script working again  but I have not had any luck.  I've tried uninstalling and reinstalling Microsoft Office per instructions from Microsoft.  I have all the latest updates and patches. Any help would be greatly appreciated.
    Here is the original code which used to work just fine.
    -- Stephen Norum
    -- [email protected]
    property pdf_ext : ".pdf"
    on remove_extension(file_path)
        -- remove the extension if it exists
        set stripped to do shell script ("F=" & quoted form of file_path & " ; echo ${F%.*}")
        return stripped
    end remove_extension
    on get_pdf_path(doc_path)
        set doc_path to remove_extension(doc_path)
        -- Try the simple name first
        set pdf_path to (doc_path & pdf_ext)
        -- Otherwise, number the pdfs
        set counter to 1
        tell application "Finder"
            repeat while (exists pdf_path)
                set pdf_path to (doc_path & " " & counter & pdf_ext)
                set counter to counter + 1
            end repeat
        end tell
        return pdf_path
    end get_pdf_path
    on run {input, parameters}
        repeat with file_name in input
            tell application "Microsoft Word"
                open file_name
                set the_doc to active document
                set doc_path to path of the_doc
            end tell
            set pdf_path to get_pdf_path(doc_path)
            tell application "Microsoft Word"
                save as active document file name pdf_path file format format PDF
                close active document
            end tell
        end repeat
        tell application "Finder"
            activate
        end tell
        return input
    end run

    try this syntax:
                        tell application "Microsoft Word"
      save as (active document) file name pdf_path file format PDF
                        end tell
    Apparently they changed the enumeration label from format PDF to just plain old PDF without bothering to update the scripting dictionary or ensure backward compatibility. If you want to know how they managed to do that, they are still not using sdef or even scriptSuite xml files, but are loading the scripting information from old-school (i.e. os 8 or os 9 style) resource files.
    I've occasionally considered writing Microsoft a proposal to redo the Office scripting dictionaries so they are less crazy-making, but I'm not sure I'd survive the attempt.

  • Change selected file in automator using applescript ???

    So I'm getting better at using Automator to create useful Services but still a bit of a newbie with doing powerful things with AppleScript... and I think this task requires some applescripting. Here's what I want to do:
    1. Based on a selected text file I want to run a pre-existing script that converts this file into an HTML file. This new file has the same name as the text file but has the .html extension rather than the .txt extension. (This step is easy enough with Automator and it works just fine already.)
    2. BUT NOW, I want to take that resulting HTML file and run another pre-existing script that converts the HTML file into an RTF file. The problem is that I basically want to change the selection from selectedfile.TXT to selectedfile.HTML so that I can proceed to this next step...
    3. AND THEN, I want to launch an app with this resulting RTF file. Again, I need to change the selection to selectedfile.RTF.
    Right now this requires me to run three different automator services, and changing the selected file between each step... But I'm sure there's an easy applescript way (or other way) to do this using just one service -- probably involves some filename parsing and some magic to change the selection??? -- or something like that...
    Could anyone point me in the right direction???
    Thank you thank you thank you!
    ~zyyyy

    Have you considered using a bash script? You can even write the script in an Automator Service.
    Open Automator and select Service from the main screen. Set the ‘Service Receives Selected’ pop-up menu to Files or Folders, and set the ‘in’ pop-up to Finder. Drag Run Shell Script from the Utilities section of the actions library into the workflow area. Set Pass Input to As Arguments. Replace the sample code in the input area with this:
    for f in "$@"
    do
    file_ext="${f##*.}"
    if [ $file_ext = "txt" -o $file_ext = "TXT" ] ; then
    /usr/bin/textutil -convert html "$f"
    /usr/bin/textutil -convert rtf "${f/$file_ext/html}"
    /usr/bin/open -a /Applications/TextEdit.app "${f/$file_ext/rtf}"
    fi
    done

  • Keyboard macros with Applescript

    Hello - I am new to PP from FCP 7 and I am trying to set up some new workflows that should really save some time.  I am also very new to Keyboard macros with Applescript - but I love the concept and almost everything I have tried has worked so far - with one exception - and I can't figure it out for the life of me figure it out
    So here is what I would like to do:
    I want to cut out clips from interviews and make subclips.  I need to keep a visual record of what I pulled and from where.
    Here is how I do it:
    I lay out all synced audio and video of interviews in a timeline sequence.  I go allong and find the in point of a clip i'd like to create a subclip of, and I hit command+k to cut all active tracks.  I then find my out point of said clip and hit command+k again.  I select the clip and hit option+ up arrow (NOTE - i have the layers set in a way that this clearly differentiates the clip I've pulled and it works by haveing go up from track 1 to 2 and audio up from track 2 to 1).  I then create a subclip of that clip with a keyboard shortcut I have set up as control+d.  Then back to searching for the next clip.
    How I would like to do it with keyboard automation via applescript:
    Find the clip and command+k "cut" the in point and put the playhead at the out point and run the following script:
    tell application "Adobe Premiere Pro CC"
        activate
    end tell
    tell application "System Events"
        keystroke "k" using {command down} # my 2nd "out" blade cut for the clip i want
        delay 0.2
        key code 126 # (up arrow) send playhead back to the start of the clip
        delay 0.2
        keystroke "d" # selects the clip at playhead
        delay 0.2
        key code "126" using {option down} #NOT WORKING - (option+up arrow) to shift my clip up 1 layer
        delay 0.2
        keystroke "d" using {control down} # shortcut i created to make subclip
        delay 0.2
        key code 36 # (return key) approves defalt subclip settings
        delay 0.2
        key code 20 using {shift down} # (Shift+3) selects timeline pannel
        delay 0.2
        key code 125 # (arrow up) goes to next cut
    end tell
    So - as you can see - the one thing I can not get to work is any key command to shift a clip up in the timeline.  What is really bizzare is that even if I change the keyboard short cut from "option+up arrow" to anythiing else, apple scrip will just not exicute that command.  The correct pannel is selected, everything else works, and of couse when I try the actual option+up arrow without involving scrpt at all - it works. 
    Can anyone who might be a little more firmilliar with scriping macros please take a look at my code and tell me what I might be doing wrong.  Thank you!

    I think i already found a solution to my problem: Butler.
    Sorry for the confusion.

Maybe you are looking for

  • All offering not displaying in Learning Path

    Hi, We have created a course which contains 3 offerings (with different delivery modes), each offering have 1 class. When we attach this course to a learning path and an employee subscribes to this learning path, only one offering is getting displaye

  • Need to find out department having maximum total salary among all depts

    Hi, I am new to oracle. I was wondering how would I create a query for following condition. I have a employee table. There are columns like emp_id, emp_name, emp_dept, emp_sal I need to find out department having maximum total salary among all depart

  • Java.sql.SQLException: ORA-00932: incnsistent dtatyps: expctd DATE got NUM.

    Hi, I get this error when I try to supply a String object as the query parameter to the where clause. The annoying thing is when I convert the value that I pass to a date object, the error message would change to expected NUM got DATE!!! how can I so

  • Apple logo appears only and cant restore in recovery mode

    iphone4 wont work tried everything. the only thing that it shows is the appl logo and whe i put it into recovery mode it wont let me restore or update

  • Release Stregty

    Dear All, I create a PO and release. My Release Stregty as Below 1. Release Code as and release final release same as series given below I4         INITIATOR-P&E GM       APPROVAL-GM(PUR) PH        P&E Head 2.  In Classification i maintain as Documen