Applescript: insert string in filter or check item in list

Friends and experts:
I'm trying to get my script to check for particular system voice and if it not found, to prompt the user to install it before the main body of the script runs.
From everything I've read, it seems that I'm going to have to do this via GUI scripting (but if anyone can offer a better alternative I'd love to hear it - the GUI script is clumsy and not to my liking. Anyway...)
I've cobbled together a clumsy GUI script to do all but the last part - how to check the item I want, or alternatively have a string placed in the filter bar so that only that item will be shown to the user. This is the UI element I'm wrestling with:
And this is the portion of the script that deals with open sys prefs, selecting the system voice button and bringing up the 'Customize...' menu.
openSys()
delay 0.5
openVoice()
on openSys()
          tell application "System Preferences"
  activate
                    set current pane to pane "com.apple.preference.speech"
                    reveal anchor "TTS" of current pane
          end tell
end openSys
on openVoice()
          tell application "System Events"
                    tell process "System Preferences"
                              click pop up button 1 of tab group 1 of window "Dictation & Speech"
                              click menu item "Customize..." of menu of pop up button 1 of tab group 1 of window "Dictation & Speech"
                    end tell
          end tell
end openVoice
Can anyone help me solve the last piece of the jigsaw? Suppose, for example, I want 'Alva'. How do I check that or add 'Alva' to the filter bar?

Thanks for the tips, Frank & red_menace.
Actually, getting the available voices isn't the issue. The script relies on one particular foreign language voice, and the easiest way to test for that is just to start the script with an empty 'say' command using the required voice:
say "" using voice "Narisa"
If "Narisa" isn't installed, it'll throw error code -244, so I can catch that and prompt the install. If it is installed, the script simply moves on to the next line of code.
Ironically, I'd only got into AppleScript in recent months after realising I could do certain things much easier than with Bash or struggling with Cocoa, which I'm still very much a novice at. However, I think what I've learned here is that it's a case of using the right tool for the job. Since AS seems unable to pull off what I want to do, I'll put this on hold and go back to learning Obj C, Cocoa and XCode.
Although I didn't get the answer I wanted (a way to do it with AS), I think the answer is that I need to move this project to XCode, utlize the Applescript that I've got and add the required Cocoa classes as necessary.
Thanks again both for your input. Lesson learned!

Similar Messages

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • QSUF (Query string url filter) and SQL Server reporting services report viewer parameters

    Hi,
    this is my issue:
    I have a SQL Server reporting services web part on a page with a report with 1 parameter, lets say it's a client list
    Then i have a QSUF that will be used to filter the clients list through the URL
    However, once i connect the filter and the report viewer web part, the parameter goes away and is no longer accessible
    I'd like to somehow keep the parameter visible, in case there is no parameter sent through the URL, i would like the user to be able to choose a client from the parameter drop down list
    I saw that there is a "send empty if no values are passed" option, but i can't seem to get this working properly and i don't know if this option will make the parameter visible again
    Any help would be appreciated
    Thanks.

    Hi,
    According to your post, my understanding is that the query string url filter web part not worked well with SQL server reproting services web part.
    Did you use the Wiki page layout in your environment?
    You can change the page to a web part page, then check whether it work.
    There is a similar thread for your reference.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/4d7584e3-8e1a-48bf-9346-32f8cb480dd1/query-string-url-filter-web-part?forum=sharepointgeneralprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Combine checked item and update column

    Hi all,
    need to design a screen that allow user to update column (code) and also pick which statement to display for the next stage. My thought was to create a checkitem and LOV display. Once user has checked the box , the process should update the code first then select the checked item into a new table. But it appears to me I can get checked item cocept to work and inserted it to a new table but fail to address the LOV update. Can you help ?
    table: sample1, display as the following
    seq     code     comments amt
    1     T     test1     30
    2     A     test2     20
    3     T     test3     80
    4     T     test4     20
    user action: picked seq 1,2  and update code from A to T for seq2
    ==> process will insert the selected statement to result table
    table:result
    seq     code     comments amt
    1     T     test1     30
    2     T     test2     20mushar

    I am sorry . Just realized I posted this to a wrong forum.

  • Forwarding agreement can not release; Check items and calculation sheets.

    Hi Experts,
    While releasing status of a forwarding agreement to getting error message "Agreement can not release; Check items and calculation sheets''.
    Please refer the screen shot attached and suggest.
    Thanks & Regards,
    Shaktiprasad Dash

    Hello Shakthi,
    Firstly, have you maintained TCCS in your forwarding agreement?
    You migt have  inserted new item. However, there are no TCCS maintinaed in that agreement item.
    In such cases those error messages are displayed. Restricting you from releasing the agreement.
    Other cases:
    is your TCCS local?
    If your TCCS is global then ideally the charge usage should be any of the below: "customer", "Customer & service" or "ALL" for Forwarding Agreement to consume it.
    For Local TCCS by defalut charge usage will be set to "Customer".
    If Local, check whether have you missed any mandatory fields like amount, Currency.
    If there are any % charge line, then the refrence number would have been missing or you might be referencing incorrectly.
    For Global TCCS if any of the above is incorrectly maintianed it will not allow you to save the TCCS.
    If you can attach the screenshot of  the TCCS it will be helpful for me to solve your issue.
    Best Regards,
    Dimpu

  • Match only checked items - iphone ignores it!

    I have a smart playlist that I want to sync with my iphone via icloud.  It is set to match only checked items.  It updates accordingly in itunes, but on the iphone it includes all of the unchecked items!
    I feel like I'm going crazy.  iCloud and itunes match are so buggy and inconsistent.  Am I just missing something?
    (PS, it doesn't help if I add a filter to the playlist that adds only checked files)

    Hi guys,
    I think I found a solution for this problem !
    Instead of checking the "Match only checked items", just add the rule "Checked = is true" like below:
    I've tried this and it works ! The smart playlist now contains the same songs in iTunes and all my iOS devices.
    Chears,
    TorpidLittle

  • How can I get the checked item from a list that is generated automatically?

    I am still pretty new a CF and could really use some help. I am trying to get each item that is checked from a page that generates the list automatically from a query and get the associated textbox text with it. For example:
                        <!--- Start Get Data Hierarchy List--->
                                  <cfquery datasource="MyDatasource" name="qry_GetData">
                                            SELECT C.taxonomy_id, C.lvl, C.taxonomy_name, C.taxonomy_tree, C.taxonomy_guid, C.taxonomy_standard_name
                                            FROM dbo.taxonomy AS P
                                            JOIN dbo.taxonomy AS C
                                                      ON P.taxonomy_id = 21
                                                      AND C.hid.IsDescendantOf(P.hid) = 1
                                                      AND C.lvl = 3
                                  </cfquery>
                        <!--- Start Get Data Hierarchy List--->
    <cfloop query="qry_GetData">
    <input type="checkbox" name="cbox_PE_SelTax#taxonomy_id#" value="#taxonomy_name#"><font size="4" color="3399FF"> #taxonomy_name#</font>
    <br />
         - Details of experience with #taxonomy_name#:<input name="tbox_PE_SelTax#taxonomy_id#" id="tbox_PE_SelTax#taxonomy_id#" size="50%">
    <br />
    <br />
    </cfloop>

    Dave,
    Thank you for your help so far. I must not be asking the right question. Here is the whole breakdown. I am writing this page to collect the users information, Name, Title, Company, and technologies they are familiar with. I then want that information emailed to me upon submission. The point I am running into a problem (even with your last post) is how to write the action part of it that will email the checked items to me. I cannot figure out if I need to use CFLOOP (if so, how) or what the best method is. I am a very visual lerner and can understand how code works easily, but I have not found any examples for my situation. Again, I really appriciate all of your help thus far.
    Thank you!

  • How to get all checked items from TreeView in VC++ mfc

    void CPDlg::OnTreeClk(NMHDR *pNMHDR, LRESULT *pResult)
    NMTREEVIEW& nm = *(LPNMTREEVIEW)pNMHDR;
    // which item was selected?
    HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    temp = m_columnTree.GetItemText(hItem, 0);
    MessageBox(temp);
    if (!hItem) return;
    // the rest of processing code..
    I'm new in VC++ .
    this code gives only current selected item . but i need to get all checked items from treeView.
    kindly help me..

    no not unchecked .. the all check box's gone from tree view. which means Treeview without check box.
    finally i tried SetCheck 
    void CPracticesDlg::OnSelchangedTreectrl(NMHDR* pNMHDR, LRESULT* pResult)
    NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    // TODO: Add your control notification handler code here
    tree_state = 1;//changed
    HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    BOOL chk = m_columnTree.GetTreeCtrl().GetCheck(hItem);
    if (chk == TRUE)
    HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    // Check all of the children of hmyItem.
    if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
    HTREEITEM hNextItem;
    HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
    while (hChildItem != NULL)
    hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
    m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 1);
    hChildItem = hNextItem;
    else
    HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
    // Uncheck all of the children of hmyItem.
    if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
    HTREEITEM hNextItem;
    HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
    while (hChildItem != NULL)
    hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
    m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 0);
    hChildItem = hNextItem;
    code works good . but here is i think small problem . i cant find it.
    when i click the root node it goes to checked state but not child node. again i click same root node it goes to unchecked state but all child's are goes to checked state.
    help me. here what is the problem?

  • How to keep checked items in report

    all I've a interactive report  which has checkbox column but when I click pagination next or prevoius the checked item are lost. how can I keep checked rows when I paginate in apex 4.2? regards

    You would need to populate checked items in a collection
    http://www.inside-oracle-apex.com/checkboxes-in-tabular-forms-the-easy-way/
    then have a dynamic action on refresh of the region to repopulate the checkboxes with some clever jQuery.
    Jari would be the person I'd say would have something in the order of what you're after
    DbSWH Goodies on Oracle Application Express

  • Inserting strings in a database

    Hello all!
    I am trying to insert string values in a database with this metode.
        public void insertData(){
       try{
    String url = "jdbc:odbc":"+database;
    Connection connection = DriverManager.getConnection(url, user, password);
    Statement status = connection.createStatement();
    status.executeUpdate("INSERT INTO radiograhy (Title, Red, Green, Blue,"
    + "Hue,Saturation,Value,Color,Path,IdRadiography,Description) VALUES "
    +"("+Title+","+Red+","+ Green+","+ Blue +","
    + Hue+","+Saturation+","+Value+","+Color+","+Path+","
    +IdRadiography+","+Description+")");
    }catch(SQLException e){
    e.printStackTrace();
    System.out.println(e);
    but the metode throws me an exception :
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

    This has actually nothing to do with JDBC, but with basic SQL knowledge.
    Print the complete query using System.out.println and try to find out what's wrong with it. Play with it, execute it right on the DB, etcetera. If you don't understand it, then don't bother to read some SQL tutorials how to write clean SQL.
    Once you understand SQL, I would also recommend you to use PreparedStatement instead.

  • Is there a way to keep the checkmark or initials (Sign toolbar) active so that I can check a whole list of items without going back and forth to the button?

    Is there a way to keep the checkmark or initials (Sign toolbar) active so that I can check a whole list of items without going back and forth to the button?

    There is another way to "popup" the screen. Mute and then
    unmute the cellphone.
    Sheng-Chieh

  • Inserting strings over 2000 in length

    Hi,
    I'm trying to populate a database table which contains a long and
    I've been running into two Oracle errors:
    ORA-01462: cannot insert string literals longer than 2000
    characters
    and
    ORA-01489: result of string concatenation is too long
    Can someone point me to documentation or a solution of how you
    can get a 29k string into the database? I have code regarding how
    to use LOBs, but I'm unfamiliar with any stored procedures which
    will allow you to append to a long column with new content. I
    need to use long for the project I am working on.
    Thanks in advance for your help!
    Jill
    null

    Hi Ralf,
    If you read the documentation on
    http://java.sun.com/products/jdbc/index.html you will
    find a statement saying that the JdbcOdbcDriver is
    only for test and experimental use.Yes, but my and other's experiences with the JDBC-ODBC bridge itself are very well.
    Since it is only a bridge over the specific vendor's ODBC driver, you are limited to the capabilities of that.
    But the bridge is not to blame for this.
    For MS products you may reach efforts by updating to an actual MDAC version.
    Nethertheless, with MS ODBC there are some problems.
    Search the driver database (a link is on the above web
    page) for another (commercial) driver. I recommend the
    type 4 driver from i-net.Ok.
    Have you tried out that error David reported with the i-net driver?
    I use JDBC-ODBC with MS SQLServer 2000, actual MDAC, and I get that error with PreparedStatement.
    But it's all ok with a normal statement.
    So if you could test them both with the i-net driver, we would see if it's again the MS ODBC driver.
    Regards,
    Ralf SchumacherI think, I'm not the first you asks this:
    you are not the quick one we saw in Suzuka on Sunday, are you?

  • The workflow could not check out the list item.

    Hi Guys,
    I have a workflow enabled on document library and it needs to started manually.
    Whenever user starts workflow manually, gets following error:
    "the workflow could not check out the list item. Make sure the list item is not checked out." list item is not checked out & this workflow was working smoothly earlier.
    OutCome: The workflow operation failed because the workflow lookup found no matching item.
    I have gone through below links:
    https://christopherclementen.wordpress.com/2014/05/23/oob-approval-workflow-error/
    https://social.msdn.microsoft.com/Forums/office/en-US/f673d0f6-92eb-4057-95ff-ed3cb7790360/the-workflow-operation-failed-because-the-workflow-lookup-found-no-matching-item?forum=sharepointcustomizationprevious
    Any clue on this?
    Thanks, Nilesh

    maybe check out for editing documents setting is turned on so wokrflow needs doc to ce cheked out before proceding and user might not have permission to do that.
    please refer below link:
    http://sharepoint.stackexchange.com/questions/32399/workflow-error-the-workflow-could-not-update-the-item-possibly-because-one-or
    http://community.office365.com/en-us/f/154/t/243062.aspx
    http://stackoverflow.com/questions/1272957/document-checked-out-in-sharepoint-when-workflow-starts
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • How can you tell how much space is taken by checked items?

    I have a large iTunes library (over 270 gb) and managed what goes onto my 160 gb iPod using the checked items.  It took me a long time to get it right and I would make changes (unchecking items) to accomodate new songs as I loaded them.  Somehow recently I managed to lose that information so that now everything is checked and I need to start all over.  So two questions:
    Is there anyway to "recover" what had been checked/unchecked at a given point in time?
    And, what would be most useful, is there anyway to track the amount of space taken by checked items?
    As to the last question, currently at the bottom is a status bar that tells you how many items, how much space and how many (days/hours) are taken by the full library.  It would be incredibly useful if that status bar also included the same information for checked items.  It would make it so much easier to manage the iTunes library content.

    As above use playlists. If you really need to recover the checked/unchecked status from earlier in time then I have a script that can be tweaked to do this called ExportImport, as long as earlier in time is the last time your library database got archived into the Previous iTunes Libraries folder. It is currently set up to export and then import playcounts, but adapting it to do Checked would be quite easy.
    tt2

  • Inserting String data to BLOB column

    Hi All
    I want to insert String data into BLOB column using DBAdapter - through database procedure.
    anybody can help?
    Regards
    Albin Issac

    I have used utl_raw.cast_to_raw('this is only a test')).But for bigger string I get the error as "string literal too long" do we have any similar function for longer string.
    Thanks,
    -R

Maybe you are looking for

  • Duplicate Purchase Order with all fields.

    Hi, I need a method to Duplicate a Purchase Order with ALL the fields. I tryed with a SendKey("^D") method but the new instance not copy the IC data. Looking for a better method, I read about the option to Save as XML the selected purchase, but I don

  • Actionscript not working right

    hi sorry if this is the wrong place to post this, but it seems like the right place. basically, i have some actionscript which works fine when i export an SWF using flash, or run the swf as a standalone, but when i make the SWF a projector / exe file

  • Can't open a third party CS5 project in CS5

    I purchased 3 After Effects projects from a third party website http://www.pond5.com/ and I downloaded the CS5 version on 2 of them and like CS4 on one and only the CS4 version works.  Yes I tried searching their website for help but there is none. 

  • Link missing for appraisal documents in MSS Status overview

    Hi all, For ESS Status overview page of Flexible Appraisal document, the appraisal documents are listed with links. when we click the link, its taking to the appraisal document. For MSS Status overview page of Flexible Appraisal documents, the apprai

  • Please explain the control surface in Color....

    I am new with using color, have been using Studio since initial release. When starting up color, it prompts for a control surface, giving me 3 options: Tangent Devices CP100, CP200 or JLCooper - MCS3000/Spectrum I can also also hit cancel, and I gues