How to use openwith <items>
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
How to use openwith <items>
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
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
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
Re: How to use openwith <items>
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>";
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>";
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: How to use openwith <items>
So, the syntax in XYplorer help file not work:But this works: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
Code: Select all
openwith application, [mode (s|m)], [itemlist]
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"",s,<items>"
Code: Select all
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <items>"
---------
P.S: Everything works fine when I open from Windows Explorer, the list is not duplicated
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
Re: How to use openwith <items>
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";
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: How to use openwith <items>
This still dupplicates MPC-HC's playlist (while Windows Explorer doesn't)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";
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Posts: 855
- Joined: 05 Oct 2011 13:15
Re: How to use openwith <items>
Well, the syntax is working as it should, with a real [itemlist] - being a pipe-separated list.binocular222 wrote:So, the syntax in XYplorer help file not work:But this works:Code: Select all
openwith application, [mode (s|m)], [itemlist] openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"",s,<items>"
Code: Select all
openwith """?:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" <items>"
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>";
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?
• Scripts: Session Manager | SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: How to use openwith <items>
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"
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"
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Posts: 855
- Joined: 05 Oct 2011 13:15
Re: How to use openwith <items>
Exactly.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?
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"";
^ ^ ^ ^ ^ ^ ^ ^
| |___________________________________| |_____________________________| | |__________________|
| |
|____________________________________________________________________________________________|
Hope this helps...
Will check later about the PFA / Duplicates thing.
• Scripts: Session Manager | SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
Re: How to use openwith <items>
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...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"
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: How to use openwith <items>
Then, anyway to work around?
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Posts: 855
- Joined: 05 Oct 2011 13:15
Re: How to use openwith <items>
Indeed!highend wrote:The PFA get's executed for each selected item.
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.)
• Scripts: Session Manager | SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: How to use openwith <items>
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.
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.
Last edited by binocular222 on 28 Apr 2013 15:36, edited 2 times in total.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Site Admin
- Posts: 60612
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: How to use openwith <items>
Ahem, it's <pfaitem>, not <pfaitems>!
FAQ | XY News RSS | XY Twitter
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: How to use openwith <items>
Oh, it works with run command:
I just wonder how to use openwith with <pfaitem> and command-line switch?
Code: Select all
"PFA : MPC"
run """E:\4Media\Player\Media Player Classic HomeCinema x86\mpc-hc.exe"" /add ""<pfaitem>"""
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Posts: 855
- Joined: 05 Oct 2011 13:15
Re: How to use openwith <items>
I may not understand what you're after...binocular222 wrote:I just wonder how to use openwith with <pfaitem> and command-line switch?
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>";
• Scripts: Session Manager | SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...