Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Looking for console commands for seeking forward/backward 10 seconds. (Read 947 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Looking for console commands for seeking forward/backward 10 seconds.

Good day,
I'm transitioning to foobar2000 and part of my process is setting up my media keys.
I'm using AutoHotkey for the job because it hijacks the input so I have more control over its function.
Anyway, my question is:
I have successfully set up my media keys to control foobar - hitting the key activates the Windows run command to tell foobar to increase or lower the volume. It looks like this.
$Volume_Down::Run "C:\Program Files\foobar2000\foobar2000.exe /command:Down"

The problem is that I cannot replicate this with the function "Playback/Seek/Ahead by 10 seconds" (and the inverse).
I cannot figure out what the command is to tell foobar to skip +/-10 seconds,
I have searched online to no avail, tried many guesses, and the /help command leads to a very incomplete command list.
Foobar2000 Wiki Commandline Guide
The above is the only thing I have found. I believe I would be doing /playing_command as opposed to /command but I have not found anything that works with that still.

Does anybody know where I can find a complete command list, or at least what the command is for seeking?

Your time is much appreciated
Many thanks

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #1
Try

Code: [Select]
"C:\Program Files\foobar2000\foobar2000.exe" /command:"Ahead by 10 seconds"

A command has to exist on the main menu to work and some are hidden by default so hold Shift before clicking on menus to see them all.

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #2
I tried both this:
$^Media_Next::Run "C:\Program Files\foobar2000\foobar2000.exe" /command:"Ahead by 10 seconds"
and
$^Media_Next::Run "C:\Program Files\foobar2000\foobar2000.exe /command:Ahead by 10 seconds"

The first returns an error on compilation: Unexpected ":"
▶   010: Run("C:\Program Files\foobar2000\foobar2000.exe" /command:"Back by 10 seconds")

The second tries to put tracks in my playlist which returns errors when played.
Run "C:\Program Files\foobar2000\foobar2000.exe /command:Ahead by 10 seconds"

The second is the format I use for my volume adjustment so I think this is the correct syntax but the wrong command name

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #3
In a standalone Powershell prompt, it works fine. See attachment.

Looks like : is a special character used with that autokey $run command or whatever. I have no idea about that.

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #4
Love that song. Was once available as a two track single with a "MIDI" version.

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #5
I tried both this:
$^Media_Next::Run "C:\Program Files\foobar2000\foobar2000.exe" /command:"Ahead by 10 seconds"
and
$^Media_Next::Run "C:\Program Files\foobar2000\foobar2000.exe /command:Ahead by 10 seconds"
Just a guess, but I think the problem is what AutoHotKey allows as the syntax following the Run command.  Not a FB2K problem but an AutoHotKey problem (so you should be seeking advice there not here).

What you need is a way to execute the string intact, despite that it includes spaces, but it needs to be passed as a whole so the second version is closer than the first version would be.  However, the speech mark delimiters only keep the string intact for the first stage through AutoHotKey – after that, when AutoHotKey passes that on to the operating system (to pass on again to FB2K), the OS sees 6 separate strings.

You might have more success by using inner ' delimiters, or escaping spaces with /.

Perhaps try

Code: [Select]
$^Media_Next::Run "C:\Program/ Files\foobar2000\foobar2000.exe //command:'Ahead by 10 seconds'"

If that (or other variations) doesn't work, I recommend you ask AutoHotKey gurus how to run the string

Code: [Select]
"C:\Program Files\foobar2000\foobar2000.exe" /command:"Ahead by 10 seconds"
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #6
Hey, thanks all for the help.
The working solution ended up being:

$^Media_Next::Run "C:\Program Files\foobar2000\foobar2000.exe /command:`"Ahead by 10 seconds`""
(And "Back" instead of Ahead for the inverse)

The grave characters are AHK's escape character allowing you to write the quotes inside the quotes. The code now works as intended.
Thanks again all for your time and assistance, you're great people :)

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #7
The grave characters are AHK's escape character allowing you to write the quotes inside the quotes. The code now works as intended.
Its own special escape character... I didn't think of that!

If " is a quote, what do you call ' ?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #8
I never really use ' but I would call it a single quote or probably just refer to it as an apostrophe

Re: Looking for console commands for seeking forward/backward 10 seconds.

Reply #9
A proper typographical apostrophe is a slightly different glyph. ' is a quote, " is a double quote or speech mark.
It's your privilege to disagree, but that doesn't make you right and me wrong.