Selecting a submenu item with AS (or JS)

I'm trying to invoke a submenu item from a keystroke. The item does not appear in the "Keyboard Shortcuts..." dialog. I've looked everywhere and it's just not there. It's a plugin made by Mediawide that dynamically resizes objects and pages according you my preset specs.
So I decided to just write a GUI script to invoke the menu item and then assign a keystroke to the script. The script works fine when I invoke it from the finder but if I invoke the script from the ID scripts palette, it just flashes the Apple menu for a split second and that's it. That defeats the purpose of assigning a keycommand to it.
I think it may have something to do with the fact that it activates "System Events" which is an outside app.
Can anyone shed some light on this?
Below is the script and below that, a screenshot of the menu item.
activate application "Adobe InDesign CS4"
tell application "System Events"
          tell process "Adobe InDesign CS4"
                    tell menu bar 1
                              tell menu bar item "Window"
                                        pick
                                        tell menu 1
                                                  tell menu item "Dynamic Resize"
                                                            pick
                                                            tell menu 1
                                                                      pick menu item "Resize Document"
                                                            end tell
                                                  end tell
                                        end tell
                              end tell
                    end tell
          end tell
end tell

Thank you Dirk,
That's almost got me where I need to be. Your script to open the File Info menu works fine but unfortunately my changes broke it. (BTW, I notice That in your script you ID "File Information..." when the menu item is "File Info...".  Is there a rule somewhere regarding menu item names?)
I changed the submenu item to "Window" and the itemByName to "Resize Document" but I'm still getting an error on line 5, probably because it's a submenu item as illustrated in the screenshot above. The structure is actually Main>Window>Dynamic Resize>Resize Document. I just don't know where to put the "Dynamic Resize" part of the menu structure in there.
Here's what I have
(function(){
var m = app.menus.itemByName("$ID/Main").submenus.itemByName("$ID/&Window");
// $.writeln(m.menuItems.everyItem().name);
var mi = m.menuItems.itemByName("$ID/Resize Document");
var a = mi.associatedMenuAction;
a.invoke();
Thanks
RR

Similar Messages

  • Unable to delete line item with 0 quantity in Invoice.

    Hi Experts,
    I came across a Invoice which reflects in VF04 as pending Billing due list. When i checked at the inter company Invoice i came across a line item with "0" quantity and price as zero, interestingly the replinishment cross company delivery document  for the same line item for "0" quantity had a Batch assigned to it.
    Now the issue is cusotmer has selected the line item with XX quantity and have selected the accounting document to be generated but the line item with "0 was left over and now still reflects in VF04.
    Customer does not want to reverse the full cycle to resolve the issue since the document was created a year back.My Question  is can we get the line item with "0" quantity to clear accounting so that it will not reflect in VF04.If so what will be process to do that.
    Thanks in Advance to advice.
    Regards,
    Sridhar.R

    Hi,
    It is  not possible to delete this line item, you can discuss with your client and delete it from the table.
    And now coming to the reasons why it has come into the invoice & Delivery
    1. The Batch Item category must have been configured as relevant for billing...check this and make it irrelevant if the client does not do batch specific billing. --- This will stop the batches from coming into the invoice.
    2.  Check for the batch item category in delivery if Zero quanity is allowed...if it is allowed make it not allowed and make it an Error message, whenever there is a zero quantity system will give a message.

  • Notification or Alert when selecting Item with charge on Sales Order???

    Hello,
    Is it possible to make an notification / alert on a salesorder when entering a item with batch/charge???
    Now everytime the customer must enter CTRL-TAB on amount field to select a batch but don't get a reminder for the batch.
    They don't want to select the batch/charge on Delivery.
    THX
    Mark

    Below is code that will prevent deletion of a line from Sales Order.
    DECLARE @NoOfRows int
    DECLARE @MaxLineNum int
    DECLARE @UserId int
    IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '17'
    BEGIN
    select @NoOfRows = COUNT(*) from RDR1 where DocEntry = @list_of_cols_val_tab_del
    select @MaxLineNum = MAX(LineNum) from RDR1 where DocEntry = @list_of_cols_val_tab_del
    select @UserId = UserSign2 from ORDR where DocEntry = @list_of_cols_val_tab_del
    IF(@NoOfRows <> (@MaxLineNum + 1) AND @UserId IN (10,11))
    BEGIN
    select @error = 1234
    select @error_message = 'One or more lines have been deleted from the Sales Order'
    END
    END
    You can say which users cannot modify Sales Orders like by modifying the @UserId IN (10,11) below. You need to get the User ID from the OUSR table.
    IF(@NoOfRows <> (@MaxLineNum + 1) AND @UserId IN (10,11))
    Hope this helps
    Krishnan

  • Connected webpart - add item with selected data

    Hi!
    I have a page with connected web parts.
    Example:
    List one: Companies
    a address List with companies
    List two: Employees
    A list with employees and a relation to companies (Company name).
    On the view item on companies i have list Employees connected. When i add an item i would like to have the Company name selected in the drop down.
    I have seen examples on using JavaScript but this doesn´t work in SharePoint 2013. Anyone with a solution for this, Jslink perhaps?

    Hi,
    According to your post, my understanding is that you wanted to add item with selected data in connected webpart.
    I recommend to use lookup column in the Employees to add a relation to companies.
    You can check “Yes” under “Require that this column contains information”. Then you need to select an company when you add a item.
    The result is as below:
    If you want to set the defult value for the lookup column, you can use InfoPath and no code.
    For more information, please refer to:
    SharePoint 2010 - Set default value for a lookup column using InfoPath and no code
    In addition, a simple add-on(SharePoint Default Value Add-On) which inject a "default value" section into "Create Column" dialog, seems to be a solution.
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Select bom items with object dependencies

    Hello everyone,
    this is my problem: during bom explosion from production order I want to select
    a bom item (eg 0020) only if not selected the previous item (eg 0010). there any way? what's the syntax for this object dependencies?
    Thanks to all!

    Hi,
    As per my knowledge we can use selection condition in the BOM with reference to the Characteristics value only. I don't think so, there are options based on previous item selection.
    Let's wait for PP Guru's Answers.
    Thanks,
    R.Loganathan

  • I CAN SELECT A ITEM WITH TRACK PAD, But can not open the item

    Mac Book 15 inch
    OS X 10.10
    New to Mac
    Using track pad I can select an item by one click but can not open this item with 2 clicks.

    Go to System Preferences>Track pad and check the Secondary Click settings

  • Fill column bound item with a select?

    Hi,
    I can't figure out how to do this, although I guess it's simple:
    I have a column bound item (source=db column), the item is hidden, but I want to fill it with a default value when a record is inserted. The default value must come from a select.
    I have tried it with a default value type plsql body and the "select something into :P11_Item_name from table" but that doesn't insert a value.
    Any idea how to do this, except from creating a trigger on the table itself?
    Thanks
    Guido

    Hi,
    Well this is what I want to do:
    I have an insert screen where a user can insert records.
    Among other fields that the user needs to fill in, there is one field that needs to be filled with a value that comes from another table.
    So this is the situation:
    <user value>
    <user value>
    <select value from table>
    And this altohether needs to be inserted as a new record into a table.
    I think I can manage it by uncoupling the items from the database columns, and insert a record with a on submit computation.
    But I have the idea that it can be done easier.
    I guess it's often needed that a user inserts new records where one field comes from a select from another table?
    In my example a user logs a request. This is inserted into a request table. But among the field the user enters for the request, a contact person has to be looked up (depending on the user's login) and stored into the request table as a column.
    Maybe it's an idea to create a dummy item with it's source an sql query, and copy that item into the item with it's source <database column>??
    I hope you get it, it's hard to explain.
    Regards Guido

  • Can't select multiple items with shift key os 10.7

    I can use command A to select all, and I can select multiple items with command and individually clicking each one, but not using Shift and clicking on the first and last items.  Any ideas?

    You need to display the window in column or list view. Shift-clicking items won't do that in icon view.
    (64793)

  • Sales doc items with the status CLSD ARE being selected for month-end

    We are working to improve month-end processing time for Sales Orders  We use SAPKKA12 to set CLSD status on line items
    SAP Help states: be sure that the status CLSD (closed) is set for all sales document items that you do not want to include in the period-end closing process. The sales document items with the status CLSD are then not selected for processing in the period-end closing process. Use report program SAPKKA12 to set the status.
    This use to work (in 4.0). I have been on other projects and just brought back to this after several years (now in 5.0).  Testing today shows that orders with CLSD status are being selected for month-end process.
    Any ideas why this is so?  System is selceting over 300,000 orders when well over half of them are set to CLSD.  I do get a message that the order is not relevant to processing, but selecting the order and logging the message take time. and the logs are VERY long.
    thanks

    Does any one else have this issue  that Sales documents with status CLSD are selected by RA (KKAK)?
    In just one of our jobs, i get this Basic List
    Perform actual results analysis      31273      
    Not relevant                                                 103894
    Error                                                        2306      
    Objects Selected                                    137,473
    75% of the orders are CLSD.  and the system is still counting them. (we do not out put information messages)
    I do understand that the orders are not analyzed,  but all documentaion states that CLSD status is not selected, and in our 5.0 system, they are selected.  In our 4.0 system, they were not selected.
    Does this truely work for anyone in a 5.0 system?
    Thanks
    Althea

  • Selecting listbox item with right mouse click

    Hi,
    I have a listbox control with non editable items.  Is there an easy way to select an item with a right mousebutton click (Like the left click)
    Solved!
    Go to Solution.

    Create an Event structure and generate an event on the Mouse Down? event.  Then use the Button terminal to determine if the right button was pressed.  If it was then set the value of that listbox to the row that the mouse is over.  You can do this using the invoke node Point to Row.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Can only select items with direct selection tool

    I have been working on a design: one layer, with multiple groupings, nothing is locked. I'm trying to select the items with the selection tool, but can only select items with the direct selection tool (which is very inconvenient in this case). I can select the text with the text tool, but that really serves no purpose in my case. Anyone have any ideas as to what's going on? When I was working on it yesterday, everything was fine with all the tools. Thanks in advance.

    Imcookin,
    It may be a corruption of preferences, or an issue outside Illy.
    You may try to close down and just restart, or close down and restart pressing Ctrl+Alt+Shift/Cme+Option+Shift, or close down and use the suggestions in Move the folder or, if none of those suggestions help, have a look at the list in Other options

  • How to make double column of submenu items?

    Hello,
    With DWCS3, I've used the Spry menubar to make a vertical
    menu and it looks great! Most of my items have only 2-3 submenu
    items to choose, and it works fine. However, I have one menu item
    that has maybe 20 or 30 submenu items to choose from, and so on
    mouseover, the list gets cut off by the bottom of the page. I'm
    worried that the page viewers won't think of using their "down"
    button or mouse to scroll down to see all of the possible
    selections.
    How can I make a submenu that displays as two or more
    columns? Though I know it's possible to divide things up into
    sub-submenus, I'd prefer to keep the original categories.
    Thanks!

    Hi Michel,
    If you want to do it inside the Expression Editor, this will work:
    stringleft(<columnvalue> & Local.PadString, Local.ColumnWidth)
    Where <columnvalue> is the string you want to pad out to the ColumnWidth length using the PadString.
    You can left-pad the value to a fixed length in a similar manner using stringpart() .
    Regards, Steve

  • De-link PPM Item with SAP Project

    Hello,
    Can somebdoy throw a light on what to do in case I want to de-link a PPM-item with SAP project.This situation may rise if I want to change the project actuals going to bucket A to bucket B.As I can not change the relationship of an item with the bucket, I am looking for alternate solution where I can de-link SAP Project with SAP PPM item.
    thank you!
    Regards,
    Mahendra

    Hi Mahendra
    If you are meaning to de-link a PS Project from a PPM Item, you can from the Item navigate to the 'Relationships' tab and then on the 'object links'sub-tab select and delete the assignment:
    You can also remove a cProject relationship by clicking the 'Related Objects' sub-tab
    Your comment that you cannot move an Item to a new Bucket - is this because your business process does not allow you to do so? Because this is definitely possible in the system.
    Let me know if you have any further questions as I am not sure I have addressed your question
    Regards
    C

  • SharePoint Search Service upgrade to 2013 fails: "Inner Exception: An item with the same key has already been added."

    Here's the situation:
    Upgrading a SharePoint Server 2010 Search Service Application dB to our SharePoint 2013 SP 1 development environment, using the Management Shell
    Running the following commands: 
    $applicationPool= Get-SPServiceApplicationPool -Identity 'SearchService_AppPool'
    $searchInst = Get-SPEnterpriseSearchServiceInstance -local
    Restore-SPEnterpriseSearchServiceApplication -Name 'SearchServiceApplication' -applicationpool $applicationPool -databasename 'SearchServiceApplicationDB' -databaseserver SERVERNAME -AdminSearchServiceInstance $searchInst
    Creates the search dBs (crawl, links, analytics) successfully; however, in the end, I get....
    "Exception: Action 15.0.107.0 of Microsoft.Office.Server.Search.Upgrade.SearchAdminDatabaseSequence failed."
    Looking at the ULS logs, I find the following:
    Inner Exception: An item with the same key has already been added.
    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)     at Microsoft.Office.Server.Search.Administration.OOTBSchemaDefinition.FindAndFixExistingManagedProperties()     at Microsoft.Office.Server.Search.Administration.OOTBSchemaDefinition.InstallManagedProperties(Boolean
    upgrade)     at Microsoft.Office.Server.Search.Administration.OOTBSchemaDefinition.Upgrade()     at Microsoft.Office.Server.Search.Upgrade.UpdateAllOOTBProperties.Upgrade()     at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()
    Exception: Action 15.0.107.0 of Microsoft.Office.Server.Search.Upgrade.SearchAdminDatabaseSequence failed.
    at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()     at Microsoft.SharePoint.Upgrade.SPDatabaseSequence.Upgrade()     at Microsoft.Office.Server.Search.Upgrade.SearchDatabaseSequence.Upgrade()     at Microsoft.SharePoint.Upgrade.SPUpgradeSession.Upgrade(Object
    o, Boolean bRecurse)
    Anyone encounter anything like this during their search upgrade process? I'm not honestly even sure what duplicate value to look for at this point, if I were to run a SELECT Id, ClassId, ParentId, Name, Status, Version, Properties FROM Objects on
    "SharePoint_Config" in SSMS. Any insight or opinions on the matter are welcome; and thanks to those who choose to reply to this, in advance.

    Hi ,
    You can enable the ULS log on verbose level (note, remember to reset to default level after finished troubleshooting) for more information per the following article, then check there should be more useful message for helping solve the issue.
    http://www.brightworksupport.com/enabling-verbose-logging-to-compare-against-c/
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/12c99279-d3aa-46de-bc57-d5d250692ff0/upgrade-of-search-service-application-from-2010-to-2013-failure?forum=sharepointadmin
    https://www.simple-talk.com/blogs/2014/04/22/sharepoint-2010-to-2013-search-service-application-upgrade-issueaction-15-0-80-0-fails/http://blogs.msdn.com/b/biyengar/archive/2009/10/27/psconfig-failure-with-error-an-item-with-the-same-key-has-already-been-added.aspx
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] 
    Daniel Yang
    TechNet Community Support

  • Save the selected value from listbox with its respective tab control dropdown selcted values in another listbox

    Hi all,
    I am making a vi where I have to save the selected value from listbox with its respective tab control dropdown selcted values in another listbox.Whenever I select Item1 then the heading change and respective tab will open for that item.But Now I just want to save the selection and put it in another ListBox.SO that I can renmove or add according to my wish. Plz help me.
    Solved!
    Go to Solution.
    Attachments:
    my_vi.png ‏83 KB

    Hi, I successfully make the vi to insert itmes from listbox1 to listbox2.Whenever I select itmes 1 in listbox 1 it display same elected item in listbox2 , but it not appending the items in listbox2.Like If 1 is selected in listbox1 then 1 will display , next time after saving when I selct next item like 3 then in listbox 2, 1 is replaced by 3,it dont come in second row of listbox2.Hope I am able to explain.\
    Plz help me to resolve this.
    Attachments:
    listbox_update.vi ‏11 KB

Maybe you are looking for