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

Importing session date from mix template ptx

By Mike Stankiewicz @Mike_Stankiewicz
    2022-04-05 23:45:42.906Z

    Title

    Importing session date from mix template ptx

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

    Macro is intended to open the import session data window, then naviagte finder to my mix template, select it, then option click all of my tracks in the mix template, then click ok to import them all into the session for mix.

    It actually works pretty well, but only about one in every 2-3 times i click run. Not sure where or what is hanging it up in the process of doing that. Would love to get it where it's truly a one click session import for mix prep. Thanks!

    Are you seeing an error?

    Seems to show up in different spots at times, mainly before option clicking the tracks in the import session data window I believe.

    What happens when you run this script?

    It will run and get part way through, then it will flag an error message and just stop half way through. If I hit escape and run the macro one or two more times, it ends up working perfectly fine

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "Macro is intended to open the import session data window, then naviagte finder to my mix template, select it, then option click all of my tracks in the mix template, then click ok to import them all into the session for mix. \n\nIt actually works pretty well, but only about one in every 2-3 times i click run. Not sure where or what is hanging it up in the process of doing that. Would love to get it where it's truly a one click session import for mix prep. Thanks!",
        "inputIsError": true,
        "inputError": "Seems to show up in different spots at times, mainly before option clicking the tracks in the import session data window I believe. ",
        "inputWhatHappens": "It will run and get part way through, then it will flag an error message and just stop half way through. If I hit escape and run the macro one or two more times, it ends up working perfectly fine",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 5,
        "inputTitle": "Importing session date from mix template ptx"
    }

    Source

    //Macro converted to script
    
    
    //Calling command "Import - Session Data..." from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/ckzwy99570000jp10rnhrbopn")
    sf.soundflow.runCommand({
        commandId: 'user:ckp49i4j60000a2100yfwywgf:cktcnf0ra000x9r109i8wen1u#cktcmsijz000i9r100tqfofgw',
        props: {}
    });
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.splitGroups.first.scrollAreas.first.children.whoseRole.is("AXOutline").whoseDescription.is("sidebar").first.children.whoseRole.is("AXRow").allItems[15].children.whoseRole.is("AXCell").first.getElement("AXTitleUIElement").mouseClickElement();
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.splitGroups.first.splitGroups.first.scrollAreas.first.children.whoseRole.is("AXOutline").whoseDescription.is("list view").first.children.whoseRole.is("AXRow").allItems[9].children.whoseRole.is("AXCell").first.getElement("AXTitleUIElement").mouseClickElement();
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.splitGroups.first.splitGroups.first.scrollAreas.first.children.whoseRole.is("AXOutline").whoseDescription.is("list view").first.children.whoseRole.is("AXRow").allItems[3].children.whoseRole.is("AXCell").first.getElement("AXTitleUIElement").mouseClickElement();
    
    sf.keyboard.press({
        keys: "numpad enter",
    });
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.splitGroups.first.splitGroups.first.scrollAreas.first.children.whoseRole.is("AXOutline").whoseDescription.is("list view").first.children.whoseRole.is("AXRow").allItems[3].children.whoseRole.is("AXCell").first.getElement("AXTitleUIElement").mouseClickElement();
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.splitGroups.first.splitGroups.first.scrollAreas.first.children.whoseRole.is("AXOutline").whoseDescription.is("list view").first.children.whoseRole.is("AXRow").allItems[3].children.whoseRole.is("AXCell").first.getElement("AXTitleUIElement").mouseClickElement();
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.buttons.whoseTitle.is("Open").first.mouseClickElement();
    
    sf.keyboard.press({
        keys: "numpad enter",
    });
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.splitGroups.first.splitGroups.first.scrollAreas.first.children.whoseRole.is("AXOutline").whoseDescription.is("list view").first.children.whoseRole.is("AXRow").allItems[1].children.whoseRole.is("AXCell").first.getElement("AXTitleUIElement").mouseClickElement();
    
    sf.ui.proTools.windows.whoseTitle.is("Open").first.buttons.whoseTitle.is("Open").first.mouseClickElement({
        relativePosition: {"x":55,"y":30},
        anchor: "BottomRight",
        onCancel: "ThrowError",
        onError: "ThrowError",
    });
    
    sf.keyboard.press({
        keys: "numpad enter",
    });
    
    sf.keyboard.press({
        keys: "escape",
    });
    
    sf.wait();
    
    sf.ui.proTools.windows.whoseTitle.is("Import Session Data").first.groups.whoseTitle.is("Tracks").first.tables.whoseTitle.is("Source Destination").first.children.whoseRole.is("AXColumn").whoseTitle.is("Source ").first.children.whoseRole.is("AXRow").whoseValue.is("# 0 row  Row is empty.").first.children.whoseRole.is("AXCell").first.children.whoseRole.is("AXStaticText").whoseTitle.is("Demo-REF Mix (Stereo audio)").first.mouseClickElement({
        relativePosition: {"x":0,"y":0},
        isOption: true,
    });
    
    sf.keyboard.press({
        keys: "numpad enter",
    });
    
    
    

    Links

    User UID: eqJPx9DAKYf2OFuCqSEPbaOO7Tl1

    Feedback Key: sffeedback:eqJPx9DAKYf2OFuCqSEPbaOO7Tl1:-Mzw6ebRpt3cauOwnhgj

    Feedback ZIP

    • 1 replies
    1. Hi Mike,

      To navigate in dialogs, you'll need a script that does this for you. Your macro is unstable because it's relying on clicking UI elements which may be different from time to time depending on the files on disk.

      I'd encourage to search the forum for importing session data scripts - there are a lot out there that are pretty stable :)