No internet connection
  1. Home
  2. Macro and Script Help

"Click UI element" not working in the Inspector in Sibelius

By Aleksander Waaktaar @Aleksander_Waaktaar
    2024-08-19 07:51:44.546Z

    Title

    "Click UI element" not working in the Inspector in Sibelius

    What do you expect to happen when you run the script/macro?

    I want to create a macro that toggles on/off one of the "Play on pass" checkboxes in the Inspector in Sibelius. In this specific case I want to toggle the play on pass of the first checkbox.

    In general, I am having some issues getting the "Click UI element" action to work in Sibelius. I would also like to be able to tweak the playback of trills in the inspector using the "Click UI element" in combination with some keypresses, but I have not been able to do so yet.

    Any help would be much appreciated,

    Best,
    Aleksander

    Are you seeing an error?

    What happens when you run this script?

    The checkbox simply doesn't get toggled.

    How were you running this script?

    I clicked the "Run Script" or "Run Macro" button in SoundFlow

    How important is this issue to you?

    4

    Details

    {
        "inputExpected": "I want to create a macro that toggles on/off one of the \"Play on pass\" checkboxes in the Inspector in Sibelius. In this specific case I want to toggle the play on pass of the first checkbox.\n\nIn general, I am having some issues getting the \"Click UI element\" action to work in Sibelius. I would also like to be able to tweak the playback of trills in the inspector using the \"Click UI element\" in combination with some keypresses, but I have not been able to do so yet.\n\nAny help would be much appreciated,\n\nBest,\nAleksander",
        "inputIsError": false,
        "inputWhatHappens": "The checkbox simply doesn't get toggled.",
        "inputHowRun": {
            "key": "-MpfwYA4I6GGlXgvp5j1",
            "title": "I clicked the \"Run Script\" or \"Run Macro\" button in SoundFlow"
        },
        "inputImportance": 4,
        "inputTitle": "\"Click UI element\" not working in the Inspector in Sibelius"
    }

    Source

    //Macro converted to script
    
    
    sf.ui.app('com.avid.sibelius').appEnsureIsRunningAndActive();
    
    //Calling command "Inspector" from package "Sibelius" (installed from user/pkg/version "oMDTMcbKv2OT4GaE3NFzdjMdeXj2/cltase3hr0000b31091wmxvjo/clwjutg060000p710zi9snaz6")
    sf.soundflow.runCommand({
        commandId: 'user:cltase3hr0000b31091wmxvjo:cltem2j0d0038my103ec0es5r',
        props: {}
    });
    
    sf.ui.app("com.avid.sibelius").mainWindow.groups.whoseTitle.is("Inspector").first.elementWaitFor();
    
    sf.ui.app("com.avid.sibelius").mainWindow.groups.whoseTitle.is("Inspector").first.checkBoxes.whoseTitle.is("Play on pass 1").first.elementClick();
    
    //Calling command "Inspector" from package "Sibelius" (installed from user/pkg/version "oMDTMcbKv2OT4GaE3NFzdjMdeXj2/cltase3hr0000b31091wmxvjo/clwjutg060000p710zi9snaz6")
    sf.soundflow.runCommand({
        commandId: 'user:cltase3hr0000b31091wmxvjo:cltem2j0d0038my103ec0es5r',
        props: {}
    });
    
    
    

    Links

    User UID: HZr62E3x4JTqYY905s0fS6we4jk1

    Feedback Key: sffeedback:HZr62E3x4JTqYY905s0fS6we4jk1:-O4dbhihz6p5fcAkUCxv

    Feedback ZIP: LJt0o8WNlJl/afzlJv7HjaTW8/Xbr91DCbr17RjyBpEUCJ8OUtk3V6esJpKyKFXas9HN7WtoEiO6CIK+usScQWF46WJt0QBV77bJ96kuJwpQCVAqFL4MkYlNZBfBEumOVE8wekBs2/HjDr4mUaJBSyxqJAfvwflr2ApO/1RAqRn6/RP+gY5i9oqFAzBw5DT0FKMRUL7DD0IdBulfCM6O6GaSejQ/pn5KUpAM/5qpdf2xry8A7XZ958d0ybQBwi1fDS5X2dSn8vIP0ccEO4aY6ziIea+c/z9y5zbo9lHw1Ko+OiXZWwQqfqSGH3RUp8sg1DIQ1M71O/1PzznvbxswWk6Y46eiAixtFLF9iVZj7V8=

    Solved in post #3, click to view
    • 2 replies
    1. Hi Aleksander,

      From my own tests with Sibelius, it appears that Sibelius' checkboxes in particular don't always respond correctly (or at all) to UI automation clicks. To work around this limitation in Sibelius, you can use the Mouse Click Relative to UI Element action instead, which instead of sending a UI automation press event will simulate a mouse click event, which to Sibelius is indistinguishable from you actually clicking on the checkbox with the mouse.

      1. Hi Christian,

        Thank you for your reply!
        I also discovered this, and after using Mouse Click Relative to UI element, I have been able to create most of the macros I want to.
        PS: I love Soundflow and all the work you are doing!

        Aleksander

        Reply1 LikeSolution