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

Macro no longer works when converted to a script

Title

Macro no longer works when converted to a script

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

Fade Clip in/out, shift tab to next clip, repeat

Are you seeing an error?

What happens when you run this script?

When I convert this macro to a script (and don't change anything) it no longer works.

How were you running this script?

I used a keyboard shortcut within the target app

How important is this issue to you?

4

Details

{
    "inputExpected": "Fade Clip in/out, shift tab to next clip, repeat",
    "inputIsError": false,
    "inputWhatHappens": "When I convert this macro to a script (and don't change anything)  it no longer works.",
    "inputHowRun": {
        "key": "-Mpfwh4RkPLb2LPwjePT",
        "title": "I used a keyboard shortcut within the target app"
    },
    "inputImportance": 4,
    "inputTitle": "Macro no longer works when converted to a script"
}

Source

//Macro converted to script


//Calling command "Repeat N Times" from package "Basics" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckuxffxq80000u010m7g02u3l/clycxeqx60000hy10jnc4f8zj")
sf.soundflow.runCommand({
    commandId: 'user:ckvkew1az0000jm10nyqags9h:ckuxg4i32000cu010dk8ldgm3',
    props: {
        repetitions: 2,
    }
});



Links

User UID: KI5JeIGNSQbxx0hwB8QOimtFV812

Feedback Key: sffeedback:KI5JeIGNSQbxx0hwB8QOimtFV812:-O5Jt7c1RXWWf6rrSbNO

Feedback ZIP: w/BM71MxVNIScPDO4+hiyktKR9f3qldUeY+jty30fsuB1HrvoskUfrd1axHbNg4sUoZMCT9v6iiThEP6yF8optHriD6V3LAXgIaTZN+RpJ6eazJkOQs6T6874kHSZz0q9l6kJvndLRxAgb73OqnqU55PLWsMJ5YmJr2artK01LMQ9hrxq3K+9Dt1VDn5kBS0ddIrDRuxYGtGfckK8i72dVTXJzsDNiQESIjUTXxo3MXY0OOGw7MgXdTCDmcg3qoPBGK9d6fHHYKpS8VPDKLHvAk5VEdqkJw2dxDII0khujp4izR3nhb2WInjcNRe5+78+WLpjFgGo4nrDU2MnXcvtA==

  • 5 replies
  1. In reply tosbiss:
    Kitch Membery @Kitch2024-08-27 17:34:53.433Z

    Hi @sbiss,

    What is the script you are trying to repeat inside the "Repeat N Times" action?

    1. S
      In reply tosbiss:

      Actually, I get this error:

      TypeError: Object has no method 'action'
      (Repeat N Times line 9) (Fade Clips & Repeat: Line 4)

      The macro I am trying to trigger is a termplate preset, but it is called "Repeat N Times" from package Basics. Strange.

      1. const {
            fadeInFrameLength,
            fadeInFramePrelap,
            fadeOutFrameLength,
            fadeOutFramePostlap,
            fadeInShape,
            fadeOutShape,
        } = event.props
        
        
        sf.ui.proTools.appActivate();
        sf.ui.proTools.appWaitForActive();
        sf.ui.proTools.appActivateMainWindow();
        
        
        //Calling command "Feet+Frames: 1 frame" from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/cl7ifcvv10000cz108r31chrd")
        sf.soundflow.runCommand({
            commandId: 'user:ckp49i4j60000a2100yfwywgf:ckoymrwjo0011eo10wkziecfb#ckoymru3j000chw10u0ohr21a',
            props: {}
        });
        
        sf.ui.proTools.menuClick({
            menuPath: ['Options', 'Tab to Transient'],
            targetValue: 'Disable'
        });
        
        
        
        //TRIM CLIP
        sf.ui.proTools.menuClick({
            menuPath: ["Edit","Trim Clip","To Selection"],
            onError: "Continue",
        });
        
        //CURSER TO HEAD
        sf.keyboard.press({
            keys: "alt+tab",
        });
        
        //CURSER FORWARD
        sf.keyboard.press({
            keys: "period",
            repetitions: fadeInFrameLength,
        });
        
        //FADE TO START
        sf.ui.proTools.menuClick({
            menuPath: ["Edit","Fades","Fade to Start"],
        });
        
        //SELECT FADE IN
        sf.keyboard.press({
            keys: "alt+shift+tab",
        });
        
        //MOVE FADE EARLIER
        sf.keyboard.press({
            keys: "comma",
            repetitions: fadeInFramePrelap,
        });
        
        //OPEN FADE IN WINDOW
        sf.ui.proTools.menuClick({
            menuPath: ["Edit","Fades","Create..."],
        });
        
        //SELECT SHAPE
        sf.ui.proTools.windows.whoseTitle.is("Fade In").first.buttons.whoseTitle.is(fadeInShape).first.elementClick();
        
        //RETURN
        sf.keyboard.press({
            keys: "return",
            repetitions: 1,
        });
        
        //WAIT FOR FADE IN WINDOW TO CLOSE
        sf.ui.proTools.windows.whoseTitle.is("Fade In").first.elementWaitFor({
            waitType: "Disappear",
        });
        
        
        
        
        
        //GO TO END OF CLIP
        sf.keyboard.press({
            keys: "tab, tab",
        });
        
        //RETURN
        //sf.keyboard.press({
        //    keys: "return",
        //    repetitions: 1,
        //});
        
        //CURSER BACK NUMBER OF FRAME
        sf.keyboard.press({
            keys: "comma",
            repetitions: fadeOutFrameLength,
        });
        
        //FADE TO END
        sf.ui.proTools.menuClick({
            menuPath: ["Edit","Fades","Fade to End"],
        });
        
        //SELECT FADE OUT
        sf.keyboard.press({
            keys: "shift+tab",
        });
        
        //MOVE FADE LATER
        sf.keyboard.press({
            keys: "period",
            repetitions: fadeOutFramePostlap,
        });
        
        //OPEN FADE IN WINDOW
        sf.ui.proTools.menuClick({
            menuPath: ["Edit","Fades","Create..."],
        });
        
        //SELECT SHAPE
        sf.ui.proTools.windows.whoseTitle.is("Fade Out").first.buttons.whoseTitle.is(fadeOutShape).first.elementClick();
        
        //RETURN
        sf.keyboard.press({
            keys: "return",
            repetitions: 1,
        });
        
        //WAIT FOR FADE IN WINDOW TO CLOSE
        sf.ui.proTools.windows.whoseTitle.is("Fade Out").first.elementWaitFor({
            waitType: "Disappear",
        });
        
        //sf.keyboard.press({
        //    keys: "alt+shift+tab, alt+shift+tab",
        //});
        
        
        sf.keyboard.press({
            keys: "ctrl+tab",
            repetitions: 1,
        });
        
        
        
        sf.interaction.notify({
            title: "FADED",
        });
        
        1. In reply tosbiss:
          Kitch Membery @Kitch2024-08-27 18:04:14.575Z

          I don't believe that Meta Commands from the Basic package can be converted into scripts just yet.

          You'll have to work around this by creating a new macro, adding the preset to the macro, and then converting the new macro to a script.

          Once you have the preset in code form you can then put it into a for loop. I'm happy to help you with that if you can provide the script. :-)

          1. OK. I'll give that a shot.