No internet connection
  1. Home
  2. Support

QuicktimeX

By Jonathan Grossman @Jonathan_Grossman
    2020-06-17 01:31:21.432Z

    I am trying to write a macro for QuickTime Player X and it won't even show up as a application option. I tried writing Java like this and it still didn't work.

    sf.ui.app('com.apple.QuickTimePlayerX').appActivate();

    Here's the log:

    16.06.2020 18:30:55.15 [Backend]: Logging unknown error in action (02) AppActivateAction: Value cannot be null. Parameter name: str
    Error in line 0:
    Error invoking app.activate
    System.ArgumentNullException: Value cannot be null. Parameter name: str
    at CFString..ctor(String, Boolean) + 0x6d
    at Mac.AppKit.NSRunningApplication.GetRunningApplications(String) + 0x3d
    at SoundFlow.Shortcuts.Automation.Actions.AppActivateAction.d__3.MoveNext() + 0x57
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x1c
    at sfbackend!+0xe5df0b
    at sfbackend!+0xe5de36
    at SoundFlow.Shortcuts.Automation.AutoAction`1.d__20.MoveNext() + 0x268

    << Command: SCREEN RECORD [user:cka5k7bd0000ebs1090w9ktyy:ckbio9fux0002ec10tf8dltw5]

    Solved in post #9, click to view
    • 9 replies
    1. Dustin Harris @Dustin_Harris
        2020-06-18 00:10:38.164Z

        try it like this:

            sf.app.launch({
                path: "/Applications/Quicktime Player.app",
            });
        

        Maybe that'll do it?

        Edit: the above script launches Quicktime if it's closed. If it's already open but not the focused app, your script will make it the focused app.

        1. Thanks Dustin, but this won't open the app. btw - I'm on Catalina 10.15.5 using QuicktimeX

          1. Dustin Harris @Dustin_Harris
              2020-06-18 00:27:37.851Z

              Ahh, I hadn’t realized they switched things up in Catalina (which I can’t move to yet :( )

              1. Hi Jonathan. Are you trying to launch the app or to activate it if it's already open?

                Dustin's method should work to launch the app, but it needs a valid path, and the paths changed in Catalina, so you'd need to update it with the valid path to the app.

                1. open the app, dismiss a dialog box, choose menu option "new screen recording"

                  1. In reply tochrscheuer:

                    What is the correct path for Catalina? The QuickTime app doesn’t even come up as an option in the macros application drop down. Guess it has to be java?

                    1. I don't have Catalina so I can't help you directly.
                      But if you navigate to the application in Finder you can press Option+Cmd+C to copy its path to the clipboard.

                      1. JJonathan Grossman @Jonathan_Grossman
                          2020-06-18 19:40:12.409Z2020-06-18 19:42:11.407Z

                          That worked...here's the code I used to open QT, dismiss the dialog box, put it into screen record

                             sf.app.launch({
                                  path: "/System/Applications/QuickTime Player.app",
                              });
                              
                          sf.wait({intervalMs:500});
                          
                          sf.ui.app('com.apple.QuickTimePlayerX').mainWindow.buttons.whoseTitle.is('Cancel').first.elementClick();
                          
                          sf.keyboard.press({
                              keys: "ctrl+cmd+n",
                          });
                          
                          Reply1 LikeSolution
                          1. Brilliant! Thanks for sharing, Jonathan :)