Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass arguments to open IINA #4995

Open
brysi-ux opened this issue Jun 14, 2024 · 3 comments
Open

pass arguments to open IINA #4995

brysi-ux opened this issue Jun 14, 2024 · 3 comments

Comments

@brysi-ux
Copy link

Running this command twice will open multiple IINA application bundles at a desired start time:

/Applications/IINA.app/Contents/MacOS/iina-cli "$file" -- --start="$time" --no-resume-playback --player-operation-mode=pseudo-gui

Running this command twice will open multiple IINA windows in the same application bundle:

open -a /Applications/IINA.app "$file"

Anyone know how to open multiple windows in the same bundle while passing the start and no-resume-playback arguments to them succesfully?

Running:

open -a /Applications/IINA.app "$file" --args -- --start="$time" --no-resume-playback

or:

open -a /Applications/IINA.app/Contents/MacOS/iina-cli "$file" --args -- --start="$time" --no-resume-playback

opens multiple IINA windows, however the start time does not pass succesfully.

It seems you used to be able to pass arguments to open mpv 4354 but the option was removed to improve bundle handling

I know Apple Script could be used to manually click the IINA jump command and enter a start time once the window is opened, but I'm trying to find a bash solution due to the minor delay when using GUI scripting.

@ShlomoCode
Copy link
Contributor

According to mpv-player/mpv#4354 (comment) it seems that you should call IINA directly and not through the open command

@low-batt
Copy link
Contributor

On this:

but I'm trying to find a bash solution due to the minor delay when using GUI scripting

As discussed in Automate tasks using AppleScript and Terminal on Mac, you can run AppleScript directly from Terminal using osascript. Run the following in Terminal to learn more about osascript:

man osascript

Another way to control IINA from the Terminal is to use mpv's JSON IPC interface. See this comment for an example of how to configure IINA to enable the IPC interface. This example shows me commanding IINA to seek to a specific time:

low-batt@gag ~$ echo '{ "command": ["seek", "5:00", "absolute"] }' | socat - /tmp/mpv-socket | jq
{
  "data": null,
  "request_id": 0,
  "error": "success"
}
low-batt@gag ~$ 

@brysi-ux
Copy link
Author

brysi-ux commented Jun 21, 2024

Thank you for the information about the JSON interface, I was unaware of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants