0

Where can I find documentation on Application.launch() in JXA?

Application('Safari').launch();

It seems Application.launch(), unlike Application.activate(), only starts the application process without actually open or activate an application window.

I searched the Internet and find no documentation on this function.

Zhen Yao
  • 51
  • 5
  • check this https://stackoverflow.com/questions/47940322/cant-find-jxa-documentation – tomrlh Mar 07 '19 at 01:18
  • @tomrlh, I did before posting the question, Application.launch() was not documented in any of those documents. – Zhen Yao Mar 08 '19 at 07:46

1 Answers1

1

The launch command:

Launches an application, if it is not already running, but does not send it a run command.

If an application is already running, sending it a launch command has no effect. That allows you to open an application without performing its usual startup procedures, such as opening a new window or, in the case of a script application, running its script. For example, you can use the launch command when you don’t want an application to open and close visibly.

via https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW51

Note that while the above documentation is for AppleScript, it mostly applies to JXA, too.

bacongravy
  • 893
  • 8
  • 13