INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Can startup of Media Center be delayed, to allow WiFi to connect?  (Read 590 times)

S. Pupp

  • Junior Woodchuck
  • **
  • Posts: 85

I use a Mac Mini M1 as a Media Center client, used in Theater View.  I have "Run on Mac startup" set to "Media Center."  However, on Mac startup, Media Center starts up before my Mac has connected to the WiFi network, and I get a I get the "Error Loading Library" error message. Is there a way to delay Media Center's startup a few seconds to allow the Mac to connect to the network first?  I am using Media Center 31.0.87 (Silicon).
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Can startup of Media Center be delayed, to allow WiFi to connect?
« Reply #1 on: March 07, 2024, 03:04:27 am »

You can likely use Automator to create a script shortcut that runs something like:
sleep 15 && open /Applications/MediaCenter.app

Then put the script on the Startup list instead of MC.
I'm not sure of the .app name as I don't have a Mac, please test and adjust.
Logged

S. Pupp

  • Junior Woodchuck
  • **
  • Posts: 85
Re: Can startup of Media Center be delayed, to allow WiFi to connect?
« Reply #2 on: March 08, 2024, 10:19:11 am »

You can likely use Automator to create a script shortcut that runs something like:
sleep 15 && open /Applications/MediaCenter.app

Then put the script on the Startup list instead of MC.
I'm not sure of the .app name as I don't have a Mac, please test and adjust.

That works!  Many thanks!

Full instructions here (works only for Media Center, not for Media Server):
(Modified from https://support.apple.com/guide/automator/use-a-shell-script-action-in-a-workflow-autbbd4cc11c/mac
and using the script created by zybex:)

1.  Open Automator in the Applications folder.

2.  Choose "File > New".

3.  Select "Application" as document type, then click "Choose".

4.  Type "Run Shell Script" in the search field, then select "Run Shell Script" in the search results.

5.  Erase "cat" and type (without the brackets) [sleep 15 && open "/Applications/Media Center 31.app"]

6.  Select "Save" from the File menu, and save as "Delay opening of Media Center 31" in the Applications folder.

7.  Open System Settings and go to "General>Login Items".  Click on the "+" symbol, and locate the "Delay opening of Media Center 31" application, and click "Open".

8.  Be sure that J River Media Center is not set up to open automatically:  From the "Tools" menu within Media Center, select "Options".  Select "Startup" within the Options, and make sure that "Run on Mac startup" is set to "Nothing."

9.  When restarting or shutting down, make sure to uncheck "Reopen windows when logging back in" from the dialog box, otherwise Media Center will start up without delay if it was running at time of shutdown or restart.

Upon next startup, Media Center will be started after 15 seconds, allowing time network access to occur.

I have attached a copy of the "Delay opening of Media Center 31" automator application.  It can be opened and edited with Automator to make a version for Media Center 32.

For those running a headless server, a script that would run Media Server after a delay would be helpful.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Can startup of Media Center be delayed, to allow WiFi to connect?
« Reply #3 on: March 08, 2024, 10:58:01 am »

Nice :)

On windows the MC Server is started with the /Boot argument. If it's the same for MacOS, then you can try something like:

[sleep 15 && open "/Applications/Media Center 31.app" /Boot]
or
[sleep 15 && open -a "/Applications/Media Center 31.app" --args /Boot]
Logged
Pages: [1]   Go Up