Page 1 of 2
How to use openwith <items>
Posted: 28 Apr 2013 04:32
by binocular222
I want to open selected items with Media Player Classic HC (so that all items appears in MPC-HC play list)
These not work:
openwith "?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe",s ,<items>
openwith ""?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe" /add",s ,<items>
openwith "?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe",s ,<selitems>
Help please.
---------
P.S: I guess that openwith use | to separated list of items while <items> are space-delimited
Re: How to use openwith <items>
Posted: 28 Apr 2013 07:52
by kotlmg
you have to use the full path of mpc-hc.exe. for zoommplayer and pot player i have used the following lines.
OpenWith """C:\Program Files (x86)\Zoom Player\zplayer.exe"" <items>";
OpenWith """C:\Program Files (x86)\DAUM\PotPlayer\PotPlayerMini.exe"" <items>";
similarly you can use the following lines (assuming media player classic installed in c drive)
OpenWith """C:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <items>";
Re: How to use openwith <items>
Posted: 28 Apr 2013 10:33
by binocular222
So, the syntax in XYplorer help file not work:
Code: Select all
openwith application, [mode (s|m)], [itemlist]
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"",s,<items>"
But this works:
Code: Select all
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <items>"
However, I encounter another problem: When I open multiple files, the play list double itself (i.e: open 3 files, but the list show 6 lines).
---------
P.S: Everything works fine when I open from Windows Explorer, the list is not duplicated
Re: How to use openwith <items>
Posted: 28 Apr 2013 10:55
by highend
openwith already processes the current selected items, so <items> is unnecessary...
Code: Select all
openwith "?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe";
Re: How to use openwith <items>
Posted: 28 Apr 2013 11:12
by binocular222
highend wrote:openwith already processes the current selected items, so <items> is unnecessary...
Code: Select all
openwith "?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe";
This still dupplicates MPC-HC's playlist (while Windows Explorer doesn't)
Re: How to use openwith <items>
Posted: 28 Apr 2013 11:29
by FluxTorpedoe
binocular222 wrote:So, the syntax in XYplorer help file not work:
Code: Select all
openwith application, [mode (s|m)], [itemlist]
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"",s,<items>"
But this works:
Code: Select all
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <items>"
Well, the syntax is working as it should, with a real [itemlist] - being a
pipe-separated list.
Whereas the vars
<items> or
<selitems> are
space-separated lists.
In your working example,
<items> being between the overall quotes, is part of the "application" value. Like you'd have with e.g.
(also working)
Code: Select all
run """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <items>";
About the duplicates, I tried
highend's example and this one in MPC-HC v1.6.3.5597 (under WinXPSP3) and the playlist doesn't show any duplicates...
Do you still have this problem with the "run" command?
And to make a test, do you still have it if you manually replace the <items> var with the item(s) path?
Re: How to use openwith <items>
Posted: 28 Apr 2013 12:10
by binocular222
This works:
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" D:\Movie\Amazing!\CGI\Yogin.flv D:\Movie\Amazing!\CGI\Yogin.flv"
But this doesn't (mpc-hc tells that the path is invalid)
openwith """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"",s,D:\Movie\Amazing!\CGI\Yogin.flv|D:\Movie\Amazing!\CGI\Yogin.flv"
Maybe due to quoting?
------------
P.S:
I'm using mpc-hc 1.6.7.7114
Agh, I know the reason for duplicating:
Things work fine when I run this code via address bar
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <selitems>"
However, when I save this code as PFA.xys, assign is a label (MPC), then callthe script via PFA, then the playlist will be duplicated. Here's the PFA:
flv>::load "PFA", "MPC"
Re: How to use openwith <items>
Posted: 28 Apr 2013 13:27
by FluxTorpedoe
binocular222 wrote:But this doesn't (mpc-hc tells that the path is invalid)
openwith """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"",s,D:\Movie\Amazing!\CGI\Yogin.flv|D:\Movie\Amazing!\CGI\Yogin.flv"
Maybe due to quoting?
Exactly.
As I said before, if you use quotes that include everything after the command-name, then what's inside is considered the first value/argument, here: "application". i.e. what you're doing equals
not to
openwith
"application", , "itemlist";
but to
openwith
"application, , itemlist", , ;
The "3 quotes system" if I may say, is used to include everything it can under a single argument.
We could visualize it
(correct me if I'm wrong) with an command like:
Code: Select all
command " ""path with spaces => double-quoted"" -CommandLineArgument ""Something with spaces again"" " , flag, ""list with spaces"";
^ ^ ^ ^ ^ ^ ^ ^
| |___________________________________| |_____________________________| | |__________________|
| |
|____________________________________________________________________________________________|
[/size]
Hope this helps...
Will check later about the PFA / Duplicates thing.
Re: How to use openwith <items>
Posted: 28 Apr 2013 13:55
by highend
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <selitems>"
However, when I save this code as PFA.xys, assign is a label (MPC), then callthe script via PFA, then the playlist will be duplicated. Here's the PFA:
flv>::load "PFA", "MPC"
Simple reason: The PFA get's executed for
each selected item. So when you have three songs selected and call a script via a pfa, the script will be executed three times...
Re: How to use openwith <items>
Posted: 28 Apr 2013 14:10
by binocular222
Then, anyway to work around?
Re: How to use openwith <items>
Posted: 28 Apr 2013 14:15
by FluxTorpedoe
highend wrote:The PFA get's executed for each selected item.
Indeed!
As a general rule for your PFA scripts, use the recent
<pfaitems> that's been made just for this!
(This was one of the problems I had with my PowerLauncher script before this var.)
Re: How to use openwith <items>
Posted: 28 Apr 2013 14:43
by binocular222
Thanks, <pfaitem> works great. However: I tried all these in PFA.xys:
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" /add ""<pfaitem>"""
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" ""<pfaitem>"""
openwith """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" ""<pfaitem>"""
openwith """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" /add ""<pfaitem>"""
All produce the same problem:
a few files are failed to added to the playlist. I guess that due to some file name contain special unicode characters. Example:
This works (all 3 files are shown in playlist):
Cat's Meow.flv
Catwalk - Black Cat Crossing.flv
Ce Que Je Suis (What I am) by Doncvoilà Studio.mp4
This also works (all 3 files are shown in playlist):
Cat デジスタ・ティーンズ応募作品『視力検査.flv
Cat's Meow.flv
Catwalk - Black Cat Crossing.flv
This not work (playlist only show Cat's Meow.flv):
Cat デジスタ・ティーンズ応募作品『視力検査.flv
Cat's Meow.flv
Catwalk - Black Cat Crossing.flv
Ce Que Je Suis (What I am) by Doncvoilà Studio.mp4
edited: changed <pfaitems> to <pfaitem> as Don said below, the result does not change.
Re: How to use openwith <items>
Posted: 28 Apr 2013 14:55
by admin
Ahem, it's <pfaitem>, not <pfaitems>!
Re: How to use openwith <items>
Posted: 28 Apr 2013 15:39
by binocular222
Oh, it works with run command:
Code: Select all
"PFA : MPC"
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" /add ""<pfaitem>"""
I just wonder how to use openwith with <pfaitem> and command-line switch?
Re: How to use openwith <items>
Posted: 29 Apr 2013 17:29
by FluxTorpedoe
binocular222 wrote:I just wonder how to use openwith with <pfaitem> and command-line switch?
I may not understand what you're after...
In your case with PFA and openwith, you shouldn't even need to use <pfaitem>
(without the "s" indeed
), it's implied.
So either line would work:
Code: Select all
"PFA : MPC"
openwith """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" /add";
openwith """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" /add", , "<pfaitem>";
To answer you question, as I had shown in the imaginary
"command" example: since the /add is inside the main quotes, it means it's part of the first argument, hence with
"openwith" just like with
"run", considering it is following the double-quoted application, this means it
is the command-line - and any other command-line argument can be added here.