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: foo_run (Read 596184 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_run 0.3.8

Reply #600
Hello,
Is there any way to nest the run commands in context sub-menu groups?

Re: foo_run 0.3.8

Reply #601
Hello!
Florian, could you consider processing archived items of playlist. Now, as I understand, it is not possible (or am i wrong?), to run an archived item of playlist at an external application. The %patch% instruction returns the full path to the file in the archive including the name of the archive.
For example: for the file aaa.xm in the archive D:\bbb.zip - the %path% instruction returns D:\bbb.zip|bbb/1/2/aaa.xm.
Thank you!

Re: foo_run 0.3.8

Reply #602
Super interesting component.. thank you for the work on this!

I've got a question. I added a batch file under run service (literally just the full path to the .bat file). It works from context menu.
Now I added a button to the toolbar that is supposed to do the same. And it does, *as long as a file in the playlist is selected*.

Is there any way to lift that restriction, i.e. make it run regardless of whether anything is selected?

Re: foo_run 0.3.8

Reply #603
For example: for the file aaa.xm in the archive D:\bbb.zip - the %path% instruction returns D:\bbb.zip|bbb/1/2/aaa.xm.
Check if this works:
Code: [Select]
$substr(%path%,,$sub($strstr(%path%,|),1))

Re: foo_run 0.3.8

Reply #604
@mgpai, thanks for your reply!
but unfortunately it did not work.
The script you are proposing changes the look of the path but not the functionality.
The contents of the archive files are still not available to run using foo_run.

Re: foo_run 0.3.8

Reply #605
The contents of the archive files are still not available to run using foo_run.
Sorry, I misunderstood your question. The content of the archive files can be accessed using %_path_raw%, but looks like the extracted file cannot be accessed outside foobar.



Re: foo_run 0.3.8

Reply #608
So, you want foo_run to unpack a file into a temporary file, pass it to the external application, wait until the application ended, and repack the file back to the archive?
I don't think it's feasible.


Re: foo_run 0.3.8

Reply #610
Why do you even need to open tracks in an external application if you aren't going to be modifying them?

Re: foo_run 0.3.8

Reply #611
Why do you even need to open tracks in an external application if you aren't going to be modifying them?
In case I only need to read this track without modifying. For example, an archived music module is played in an external application.

Re: foo_run 0.3.8

Reply #612
Ah, for comparison perhaps? Do note that foo_openmpt54 has a (live playback) pattern viewer, but I can imagine it may be useful to open modules in a fully fledged tracker for examination.

Re: foo_run 0.3.8

Reply #613
Ah, for comparison perhaps? Do note that foo_openmpt54 has a (live playback) pattern viewer, but I can imagine it may be useful to open modules in a fully fledged tracker for examination.
kode54: I absolutely agree with you.

Re: foo_run 0.3.8

Reply #614
Super interesting component.. thank you for the work on this!

I've got a question. I added a batch file under run service (literally just the full path to the .bat file). It works from context menu.
Now I added a button to the toolbar that is supposed to do the same. And it does, *as long as a file in the playlist is selected*.

Is there any way to lift that restriction, i.e. make it run regardless of whether anything is selected?

anyone? Bueller?

Re: foo_run 0.3.8

Reply #615
I'm not sure, but I think that "Run service" works only if you select a playlist item.

Re: foo_run 0.3.8

Reply #616
I'm not sure, but I think that "Run service" works only if you select a playlist item.

Hmm. Thanks for responding!

If that's the case, does anybody happen to know any way I could make it automatically select any (or even all) playlist items before executing the rest of the service?
Cause for my thing it literally doesn't matter which item is selected, it has no relation to the playlist items.

Alternatively, is there any other option besides using foo_run that I can try, in order to run an external batch file with just one click onto a foobar menu button?

 

Re: foo_run 0.3.8

Reply #617
If it doesn't relate to any playlist item then what's the reason to work within the foobar environment and not call the batch file directly in windows (via shortcut or otherwise). What exactly does this batch file do for you to need to use it in foobar but not on a playlist item?

Re: foo_run 0.3.8

Reply #618
I'm not sure, but I think that "Run service" works only if you select a playlist item.

Alternatively, is there any other option besides using foo_run that I can try, in order to run an external batch file with just one click onto a foobar menu button?

It is possible to create a menu entry with foo_schedule.
https://hydrogenaud.io/index.php/topic,107203.msg877453.html#msg877453

Re: foo_run 0.3.8

Reply #619
If it doesn't relate to any playlist item then what's the reason to work within the foobar environment and not call the batch file directly in windows (via shortcut or otherwise). What exactly does this batch file do for you to need to use it in foobar but not on a playlist item?
Convenience

It is possible to create a menu entry with foo_schedule.
https://hydrogenaud.io/index.php/topic,107203.msg877453.html#msg877453

I'll check that out, thank you!

//edit: it works perfectly - thanks again.

//edit: to sate jazzthieve's curiosity, the batch file runs this:
Code: [Select]
foobar2000.exe /command:"Select All" /command:"Remove" /exit

Having this run on a button from within foobar effectively replaces foobar's "x" (close) button - but additionally clears out the active playlist so that the next start is "clean".

(obviously very hacky solution, but it vorkz!)

Re: foo_run 0.3.8

Reply #620
Is there some way to replace the code in the stock title/author foo_run services for Google Artist, Wikipedia Artist, etc. that will perform the search using the dynamic track metadata sent by radio streams when that option is enabled in Preferences/Networking?

Re: foo_run 0.3.8

Reply #621
I wanted foobar2000 to open apps in Linux/Wine, and this component was able to do it.  Here's an example of a command line to open the selected foobar2000 track in Audacity:

z:\usr\bin\audacity "$substr($replace(%_path%,\,/),3,300)"

The $replace() changes Windows path backslashes to Linux forward slashes, and the $substr() removes the Windows drive letter and colon to reveal the Linux path.  300 is an arbitrary number which is hopefully long enough for any filename with path.  The double quotes are necessary because there may be spaces in the track's filename.

This is a great component!

Re: foo_run 0.3.8

Reply #622
Here's another example of running a Linux app from foobar2000 under Wine.  This opens the directory of the selected track in Dolphin:

z:\usr\bin\dolphin "$substr($replace($directory_path(%_path%),\,/),3,300)"


Re: foo_run 0.3.8

Reply #624
Thanks for the great component, which I've been using for years.

I am now trying to use "foo_run" to do two things: 1) strip embedded artwork from the selected files, using metaflac; 2) add a small amount of padding back to the files, so that the tags don't have to be rewritten next time I edit the files.

Here is the command I am currently using to strip art and padding:
Code: [Select]
"C:\Program Files\flac-1.3.1-win\win64\metaflac.exe" --dont-use-padding --remove --block-type=PICTURE,PADDING "%path%"

I'm trying to work out how to run metaflac again immediately afterwards, with "--add-padding=8192", altering the same files.