Page 2 of 3
Re: how to add user options for xyplorer script?
Posted: 07 Sep 2012 19:29
by admin
serendipity wrote:
But his code uses <items> to open selected items in list, which i don't think smart dropdown buttons support, do they?
Arghh, yes, you are right. Sorry. The Smart Dropdown Buttons don't do OpenWith.
Re: how to add user options for xyplorer script?
Posted: 07 Sep 2012 19:46
by Stefan
"Smart Dropdown Buttons", it seams i had forgotten them. Good feature.
Just tested and seen that it doesn't works with an single line.
An second entry is needed, and if it is only an hyphen.
Just FYI, maybe that is an unwanted behavior?
.
Re: how to add user options for xyplorer script?
Posted: 07 Sep 2012 19:50
by admin
Stefan wrote:"Smart Dropdown Buttons", it seams i had forgotten them. Good feature.
Just tested and seen that it doesn't works with an single line.
An second entry is needed, and if it is only an hyphen.
Just FYI, maybe that is an unwanted behavior?
.
See
Help:
Note that at least two items are needed to form a valid Smart Dropdown Button.

Re: how to add user options for xyplorer script?
Posted: 07 Sep 2012 20:16
by kotlmg
finally, i have learnt xyplorer script to mount, unmount and play files after mounting with xyplorer script.
the code is as follows.
Code: Select all
"Mount to which drive"
$app = "C:\Program Files\WinMount\WinMount.exe";
// end(recase("<curext>", "lower") != "iso"), "No ISO file selected, script ends.";
end( strpos("iso|bin|nrg|daa|cdi", "<curext>") == -1 ), "No ISO file selected, script ends.";
$iso = quote("<curitem>");
//inputselect(header, listdata, [separator=|], [style=1], [cancel], [width=600], [height=400], [windowcaption])
$drive = inputselect("Mount as which drive?<crlf>$iso", Z|Y|W|V|U|T,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
//tab([operation], [data], [index])
tab("new", $drive:);
"Mount to which drive and Play with KMPlayer"
$app = "C:\Program Files\WinMount\WinMount.exe";
// end(recase("<curext>", "lower") != "iso"), "No ISO file selected, script ends.";
end( strpos("iso|bin|nrg|daa|cdi", "<curext>") == -1 ), "No ISO file selected, script ends.";
$iso = quote("<curitem>");
//inputselect(header, listdata, [separator=|], [style=1], [cancel], [width=600], [height=400], [windowcaption])
$drive = inputselect("Mount as which drive?<crlf>$iso", Z|Y|W|V|U|T,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
//tab([operation], [data], [index])
tab("new", $drive:);
OpenWith """C:\Program Files (x86)\The KMPlayer\KMPlayer1.exe""$drive:";
"Un mount which drive"
$app = "C:\Program Files\WinMount\WinMount.exe";
//unmount <drive|all>: Unmount image file.
//Example: unmount drive F: .
//Command: piso unmount F:
$drive = inputselect("Unmount which drive?", Z|Y|W|V|U|T,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
//run
run """$app"" -unmount:$drive:";
"Un mount all !!!"
$app = "C:\Program Files\WinMount\WinMount.exe";
run """$app"" -unmountall";
Re: how to add user options for xyplorer script?
Posted: 09 Sep 2012 16:05
by kotlmg
serendipity, can you give the xyplorer script for the following command lines.
1. Mount compressed file(s) or folder(s)
Command: winmount -m [file path] [-drv:disk letter or path] [-NoWriteback:] [-attach:]
Introduction:
-drv: mount files to disk or path (Not necessary)
-NoWriteback: read only (Not necessary)
-attach: mount using filter drive. Filter drive meas mounting to an exist path.
[file path] can be quoted with whole path, relative path or default
Examples:
1) mount compressed file
winmount -m "E:\test.mou" -drv:Z:\abc
2) mount folder
winmount -m "E:\test" -drv:Z:\abc
3) mount muti files or folders (seperate paths with space)
winmount -m "E:\test.mou" "E:\test.rar" "E:\test.zip" -drv:Z:\abc
Appropriate for *.mou,*.rar,*.zip or folder
2. Mount CD/DVD file(s)
Command: winmount -m [file path] [-drv:disk] [-NoWriteback:] [-attach:]
Example: winmount -m "E:\test.iso" -drv:Z:\abc
Appropriate for *.iso, *.bin, *.cue, *.ccd, *.mds, *.mdf, *.nrg,, *.img, *.isz, *.ape, *.flac, *.wv
Also appropriate for *.wim, *.wmt
3. Mount muti partition file(s)
Command: winmount -m HDD_file [-drv:disk] [-Part:partition number(0,1...)] [-NoWriteback:]
Introduction: -Part:partion number,0 is the first partition, 1 is the second partition
Example: winmount -m Win2003.vhd -part:2
Appropriate for *.vhd, *.vdi, *.vmdk
4. Mount new blank disk
Command: winmount -drv:X -sectors: disk size
0x400000=2G, 0x200000=1G
Example: winmount -drv:X -sectors:0x400000
5. Quick mount
Command: winmount -M [file path] -attach: -drv:disk
Example: winmount -M E:\test.mou -attach: -drv:E
6. unmount
1) unmount the assigned disk
winmount -unmount:X
2) unmount all disks
winmount -unmountall
7. Compression
Command: winmount -C [file list] [-o:target file]
Introduction:
-o:assign the target file, can be whole path, relative path or default.
Example: winmount -C "E:\test" "E:\test.txt" -o:E:\test.zip
Appropriate for *.mou, *.zip, *. 7z
8. Decompression
Command: winmount -E [compressed file list] [-o:target folder]
Example:winmount -E "E:\test.zip" "E:\test.mou" -o:E:\
Appropriate for *.mou, *.zip, *.rar, *.7z
9. Smart-extraction
Command: winmount -E [compressed file list] "-s:target folder"
Example: winmount -E "E:\test.zip" "E:\test.mou" “-s:E:\test”
10. Convert
Command: winmount -T [compressed file]
Example: winmount -T E:\test.rar
Appropriate for *.rar, *.zip, *.7z
Re: how to add user options for xyplorer script?
Posted: 09 Sep 2012 22:12
by serendipity
Sorry kotlmg, but no, that's a huge list. I don't mean to be rude or something, I think I have given you enough pointers of how to do this. The rules are pretty much the same. Please read help>Scripting commands reference>openwith and run.
If you run into errors for anything specific, i'd be happy to help.

Re: how to add user options for xyplorer script?
Posted: 10 Sep 2012 06:00
by kotlmg
it's ok. i will try the code.
Re: how to add user options for xyplorer script?
Posted: 11 Sep 2012 16:49
by kotlmg
i tried the following code. it is not working. even though it is not showing any errors, the desired output is not gettin generated. am i missing some thing in the following code?.
Code: Select all
"Decompress"
// $app = "C:\Program Files\WinMount\WinMount.exe";
$destination = inputfolder( ,select destination folder to move to);
// winmount -E [compressed file list] [-o:target folder]
// run """$app"" -E<items> -o:$destination";
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E<items> -o:$destination:";
Re: how to add user options for xyplorer script?
Posted: 11 Sep 2012 23:31
by PeterH
- some " " missing in parameters?
- did you try to analyse code in step mode?
Re: how to add user options for xyplorer script?
Posted: 11 Sep 2012 23:58
by serendipity
kotlmg wrote:i tried the following code. it is not working. even though it is not showing any errors, the desired output is not gettin generated. am i missing some thing in the following code?.
Code: Select all
"Decompress"
// $app = "C:\Program Files\WinMount\WinMount.exe";
$destination = inputfolder( ,select destination folder to move to);
// winmount -E [compressed file list] [-o:target folder]
// run """$app"" -E<items> -o:$destination";
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E<items> -o:$destination:";
Maybe try:
Code: Select all
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
// run """$app"" -E<items> -o:$destination";
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E$items -o:$destination:";
Re: how to add user options for xyplorer script?
Posted: 12 Sep 2012 04:46
by kotlmg
your suggestion helpd me towrite the following winmount package.
Code: Select all
"Mount to which drive"
$app = "C:\Program Files\WinMount\WinMount.exe";
//inputselect(header, listdata, [separator=|], [style=1], [cancel], [width=600], [height=400], [windowcaption])
$drive = inputselect("Mount as which drive?<crlf>$iso", Z|Y|W|V|U|T|S|R|Q|P|O|N|M|L|K|J|I|H|G,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
//tab([operation], [data], [index])
tab("new", $drive:);
"Quick Mount"
$app = "C:\Program Files\WinMount\WinMount.exe";
//inputselect(header, listdata, [separator=|], [style=1], [cancel], [width=600], [height=400], [windowcaption])
$drive = inputselect("Mount as which drive?<crlf>$iso", Z|Y|W|V|U|T|S|R|Q|P|O|N|M|L|K|J|I|H|G,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
// winmount -M [file path] -attach: -drv:disk
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -M <items> -drv:$drive:";
wait(2000); // wait 2 seconds
//tab([operation], [data], [index])
tab("new", $drive:);
"Mount to which drive and Play with KMPlayer"
$app = "C:\Program Files\WinMount\WinMount.exe";
// end(recase("<curext>", "lower") != "iso"), "No ISO file selected, script ends.";
//inputselect(header, listdata, [separator=|], [style=1], [cancel], [width=600], [height=400], [windowcaption])
$drive = inputselect("Mount as which drive?<crlf>$iso", Z|Y|W|V|U|T|S|R|Q|P|O|N|M|L|K|J|I|H|G,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
//tab([operation], [data], [index])
tab("new", $drive:);
OpenWith """C:\Program Files (x86)\The KMPlayer\KMPlayer1.exe""$drive:";
"Un mount which drive"
$app = "C:\Program Files\WinMount\WinMount.exe";
//unmount <drive|all>: Unmount image file.
//Example: unmount drive F: .
//Command: piso unmount F:
$drive = inputselect("Unmount which drive?", Z|Y|W|V|U|T|S|R|Q|P|O|N|M|L|K|J|I|H|G,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
//run
run """$app"" -unmount:$drive:";
"Un mount all !!!"
$app = "C:\Program Files\WinMount\WinMount.exe";
run """$app"" -unmountall";
"Compress"
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
OpenWith """C:\Program Files\WinMount\WinMount.exe""-C$items";
"Decompress"
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
$destination = inputfolder( ,select destination folder to move to);
// run """$app"" -E<items> -o:$destination";
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E$items -o:$destination:";
// winmount -E [compressed file list] "-s:target folder"
"Smart Extraction"
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
$destination = inputfolder( ,select destination folder to move to);
// winmount -E [compressed file list] "-s:target folder"
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E$items -s:$destination:";
"Convert"
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
// winmount -T [item1]
OpenWith """C:\Program Files\WinMount\WinMount.exe""-T$items";
Re: how to add user options for xyplorer script?
Posted: 12 Sep 2012 05:23
by serendipity
kotlmg wrote:your suggestion helpd me towrite the following winmount package.
Glad that helped.
Re: how to add user options for xyplorer script?
Posted: 03 Jan 2013 09:33
by binocular222
Great script. I just added minor improvement:
+ Add label to caption so that each function can be called directly via address bar or Custom Toolbar Button, for example: ::load "MountISO", "Mount"
+ When select drive to mount, only unused drives are shown
+ If selected file is not ISO, then the error message is displayed in statusbar instead of a dialog (less obstrusive)
Code: Select all
"Mount to : Mount"
$app = "E:\2System\Virtual drive\WinMount\WinMount.exe";
$AllDrive = C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z ;
$CurrentDrives = replace(get("drives"), ":\") . |;
$Position = 0;
$Drive = C;
While($Drive != ""){
$Drive = substr($CurrentDrives,$Position,2);
$AllDrive = replace($AllDrive,$Drive);
$Position = $Position + 2;
};
If( strpos("iso|bin|nrg|daa|cdi", "<curext>") == -1 ) {Status "Not image file", ,"stop"; end 1};
Else
{
$drive = inputselect("Currently selected item:<crlf><curitem>", $AllDrive,,2,,650,450, "Select drive letter for new Virtual Drive");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """E:\2System\Virtual drive\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
tab("new", $drive:);
}
P.S: What's the difference between "Mount as which drive" and "quick mount"?
Re: how to add user options for xyplorer script?
Posted: 03 Jan 2013 10:32
by kotlmg
hello binocular222,
thanks for your appreciation. there is no difference between quick mount and mount to drive. i have modified my code taking your code into account.
Code: Select all
"Mount to : Mount"
$app = "C:\Program Files\WinMount\WinMount.exe";
$AllDrive = C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z ;
$CurrentDrives = replace(get("drives"), ":\") . |;
$Position = 0;
$Drive = C;
While($Drive != ""){
$Drive = substr($CurrentDrives,$Position,2);
$AllDrive = replace($AllDrive,$Drive);
$Position = $Position + 2;
};
If( strpos("iso|bin|nrg|daa|cdi|zip|rar", "<curext>") == -1 ) {Status "Not image file", ,"stop"; end 1};
Else
{
$drive = inputselect("Currently selected item:<crlf><curitem>", $AllDrive,,2,,650,450, "Select drive letter for new Virtual Drive");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
tab("new", $drive:);
}
"QuickMount : Quick"
$app = "C:\Program Files\WinMount\WinMount.exe";
$AllDrive = C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z ;
$CurrentDrives = replace(get("drives"), ":\") . |;
$Position = 0;
$Drive = C;
While($Drive != ""){
$Drive = substr($CurrentDrives,$Position,2);
$AllDrive = replace($AllDrive,$Drive);
$Position = $Position + 2;
};
If( strpos("iso|bin|nrg|daa|cdi|zip|rar", "<curext>") == -1 ) {Status "Not image file", ,"stop"; end 1};
Else
{
$drive = inputselect("Currently selected item:<crlf><curitem>", $AllDrive,,2,,650,450, "Select drive letter for new Virtual Drive");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
//OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -M <items> -drv:$drive:";
wait(2000); // wait 2 seconds
tab("new", $drive:);
}
"Play with KMPlayer"
$app = "C:\Program Files\WinMount\WinMount.exe";
$AllDrive = C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z ;
$CurrentDrives = replace(get("drives"), ":\") . |;
$Position = 0;
$Drive = C;
While($Drive != ""){
$Drive = substr($CurrentDrives,$Position,2);
$AllDrive = replace($AllDrive,$Drive);
$Position = $Position + 2;
};
If( strpos("iso|bin|nrg|daa|cdi|zip|rar", "<curext>") == -1 ) {Status "Not image file", ,"stop"; end 1};
Else
{
$drive = inputselect("Currently selected item:<crlf><curitem>", $AllDrive,,2,,650,450, "Select drive letter for new Virtual Drive");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """C:\Program Files\WinMount\WinMount.exe"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
//tab([operation], [data], [index])
tab("new", $drive:);
OpenWith """C:\Program Files (x86)\The KMPlayer\KMPlayer1.exe""$drive:";
"Un mount which drive"
$app = "C:\Program Files\WinMount\WinMount.exe";
//unmount <drive|all>: Unmount image file.
//Example: unmount drive F: .
//Command: piso unmount F:
$drive = inputselect("Unmount which drive?", Z|Y|W|V|U|T|S|R|Q|P|O|N|M|L|K|J|I|H|G,,2,,650,250, "XYplorer piso");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
//run
run """$app"" -unmount:$drive:";
"Un mount all : UnMountAll"
$app = "C:\Program Files\WinMount\WinMount.exe";
run """$app"" -unmountall";
"Compress"
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
OpenWith """C:\Program Files\WinMount\WinMount.exe""-C$items";
"Decompress"
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
$destination = inputfolder( ,select destination folder to move to);
// run """$app"" -E<items> -o:$destination";
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E$items -o:$destination:";
// winmount -E [compressed file list] "-s:target folder"
"Smart Extraction"
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
$destination = inputfolder( ,select destination folder to move to);
// winmount -E [compressed file list] "-s:target folder"
OpenWith """C:\Program Files\WinMount\WinMount.exe""-E$items -s:$destination:";
"Convert"
//Get items names as "item1" "item2" etc
$char= chr(34);
$items = $char.get ("SelectedItemsPathNames", "$char $char").$char;
// winmount -T [item1]
OpenWith """C:\Program Files\WinMount\WinMount.exe""-T$items";
Re: how to add user options for xyplorer script?
Posted: 03 Jan 2013 16:06
by binocular222
Another minor clean-up:
Instead of repeating "C:\Program Files\WinMount\WinMount.exe" twice in each sub-script, you can define either (1) a permanent variable or (2) a global variable. It's easier in case you need to change the path. I demonstrate method (2):
Code: Select all
"_Variable"
Global $Winmount;
$Winmount = "C:\Program Files\WinMount\WinMount.exe"
"Mount to : Mount"
Load "*", "_Variable";
Global $Winmount;
$AllDrive = C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z;
$UsedDrives = replace(get("drives"), ":\") . |;
$Position = 0;
$Drive = C;
While($Drive != ""){
$Drive = substr($UsedDrives,$Position,2);
$AllDrive = replace($AllDrive,$Drive);
$Position = $Position + 2;
};
If( strpos("iso|bin|nrg|daa|cdi|cue|ccd|mds|mdf|img|isz", "<curext>") == -1 ) {Status "Not image file", ,"stop"; end 1};
Else
{
$drive = inputselect("Currently selected item:<crlf><curitem>", $AllDrive,,2,,650,450, "Select drive letter for new Virtual Drive");
end(strlen($drive) > 1), "Please select only one check box, script ends.";
OpenWith """$Winmount"" -m <items> -drv:$drive:";
wait(2000); // wait 2 seconds
tab("new", $drive:);
}
Refer here:
http://www.xyplorer.com/xyfc/viewtopic. ... 445#p80444
btw: Winmount support a lot more file extension than your original script. I changed it to iso|bin|nrg|daa|cdi|cue|ccd|mds|mdf|img|isz