Manage User-defined Commands - how do I? . . .
Manage User-defined Commands - how do I? . . .
I set up a script that takes two highlighted files in the same pane and passes those file names to a file compare program that then shows the differences between the two files. This works fine. But how do I get the script to pass one highlighted file in one pane and another highlighted file in the OTHER pane to my file compare program? What do I need to do to accomplish this? Thank you.
Here is my present script:
Action: Open selected List item(s) with specified application.
Caption: Compare 2 files
Application: "C:\Program Files\Compare It!\wincmp3.exe" <items>
Mode: Single instance (pass all the items to the same instance of the application).
The program Free Commander does this and it is really nice.
Here is my present script:
Action: Open selected List item(s) with specified application.
Caption: Compare 2 files
Application: "C:\Program Files\Compare It!\wincmp3.exe" <items>
Mode: Single instance (pass all the items to the same instance of the application).
The program Free Commander does this and it is really nice.
-
admin
- Site Admin
- Posts: 65446
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Manage User-defined Commands - how do I? . . .
OK, I'm no scripting guru, but it looks like there 's a hole in the system. We have this:
Shouldn't we also have this:???
The otis_lewd could do:
"C:\Program Files\Compare It!\wincmp3.exe" <get item 1> <get item 2>
Code: Select all
getinfo("Path", [pane])
Returns the unslashed path of any of the two panes.
a = [default] active pane
i = inactive pane
1 = pane 1
2 = pane 2
Code: Select all
getinfo("Item", [pane])
Returns the focused item of any of the two panes.
a = [default] active pane
i = inactive pane
1 = pane 1
2 = pane 2
"C:\Program Files\Compare It!\wincmp3.exe" <get item 1> <get item 2>
FAQ | XY News RSS | XY X
Re: Manage User-defined Commands - how do I? . . .
No, we should have GetControlInfo().admin wrote:Shouldn't we also have this:???
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Manage User-defined Commands - how do I? . . .
True, its not there.admin wrote:OK, I'm no scripting guru, but it looks like there 's a hole in the system. We have this:Shouldn't we also have this:???Code: Select all
getinfo("Path", [pane]) Returns the unslashed path of any of the two panes. a = [default] active pane i = inactive pane 1 = pane 1 2 = pane 2The otis_lewd could do:Code: Select all
getinfo("Item", [pane]) Returns the focused item of any of the two panes. a = [default] active pane i = inactive pane 1 = pane 1 2 = pane 2
"C:\Program Files\Compare It!\wincmp3.exe" <get item 1> <get item 2>
I use "focus PI;" after copying current pane's item. I can remove two lines of script with your new command.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Manage User-defined Commands - how do I? . . .
I skimmed through this and looks good to me.TheQwerty wrote:No, we should have GetControlInfo().admin wrote:Shouldn't we also have this:???
Re: Manage User-defined Commands - how do I? . . .
Yes, right now we use "Focus PI" in an script.serendipity wrote:True, its not there.admin wrote:OK, I'm no scripting guru, but it looks like there 's a hole in the system. We have this:Shouldn't we also have this:???Code: Select all
getinfo("Path", [pane]) Returns the unslashed path of any of the two panes. a = [default] active pane i = inactive pane 1 = pane 1 2 = pane 2The otis_lewd could do:Code: Select all
getinfo("Item", [pane]) Returns the focused item of any of the two panes. a = [default] active pane i = inactive pane 1 = pane 1 2 = pane 2
"C:\Program Files\Compare It!\wincmp3.exe" <get item 1> <get item 2>
I use "focus PI;" after copying current pane's item. I can remove two lines of script with your new command.
==> otis_lewd, here are >Examples< how you could do it right now.
But for an simple UDC command without involving an script
such <item i> <item a> would be nifty to simplify the use.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Manage User-defined Commands - how do I? . . .
What you are asking is not currently possible in an elegant way, but you can make it work like this:otis_lewd wrote:I set up a script that takes two highlighted files in the same pane and passes those file names to a file compare program that then shows the differences between the two files. This works fine. But how do I get the script to pass one highlighted file in one pane and another highlighted file in the OTHER pane to my file compare program? What do I need to do to accomplish this? Thank you.
Here is my present script:
Action: Open selected List item(s) with specified application.
Caption: Compare 2 files
Application: "C:\Program Files\Compare It!\wincmp3.exe" <items>
Mode: Single instance (pass all the items to the same instance of the application).
The program Free Commander does this and it is really nice.
Action: Go to Location
Caption: Compare 2 files
Application:
$item1=getinfo ("SelectedItemsPathNames");
focus PI;
$item2=getinfo ("SelectedItemsPathNames");
openwith """C:\Program Files\Compare It!\wincmp3.exe"" $item1 $item2";
Mode: Single instance (pass all the items to the same instance of the application).
Re: Manage User-defined Commands - how do I? . . .
Okay, I have this:
focus P1; $f1 = getinfo("SelectedItemsPathNames"); focus P2; $f2 = getinfo("SelectedItemsPathNames"); run '"C:\Program Files\Compare It!\wincmp3.exe" $f1, $f2'
But when I try to run the script the '"C:\Program Files\Compare It!\wincmp3.exe' command uses $f1 and $f2 and as the names of the files instead of the real file names. What am I doing wrong? Thank you.
focus P1; $f1 = getinfo("SelectedItemsPathNames"); focus P2; $f2 = getinfo("SelectedItemsPathNames"); run '"C:\Program Files\Compare It!\wincmp3.exe" $f1, $f2'
But when I try to run the script the '"C:\Program Files\Compare It!\wincmp3.exe' command uses $f1 and $f2 and as the names of the files instead of the real file names. What am I doing wrong? Thank you.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Manage User-defined Commands - how do I? . . .
Its should be:otis_lewd wrote:Okay, I have this:
focus P1; $f1 = getinfo("SelectedItemsPathNames"); focus P2; $f2 = getinfo("SelectedItemsPathNames"); run '"C:\Program Files\Compare It!\wincmp3.exe" $f1, $f2'
But when I try to run the script the '"C:\Program Files\Compare It!\wincmp3.exe' command uses $f1 and $f2 and as the names of the files instead of the real file names. What am I doing wrong? Thank you.
run """C:\Program Files\Compare It!\wincmp3.exe"" $f1, $f2";
Why? See here: http://88.191.26.34/XYwiki/index.php/Sc ... parameters
edit: By the way the syntax here does not use comma between file1 and 2, so remove the comma
Last edited by serendipity on 22 Mar 2010 20:59, edited 1 time in total.
Re: Manage User-defined Commands - how do I? . . .
This worked:
$f1 = getinfo("SelectedItemsPathNames", ""); focus PI; $f2 = getinfo("SelectedItemsPathNames", ""); openwith "C:\Program Files\Compare It!\wincmp3.exe" "$f1" "$f2";
Now I just have to figure out where to put it so I can call it.
$f1 = getinfo("SelectedItemsPathNames", ""); focus PI; $f2 = getinfo("SelectedItemsPathNames", ""); openwith "C:\Program Files\Compare It!\wincmp3.exe" "$f1" "$f2";
Now I just have to figure out where to put it so I can call it.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Manage User-defined Commands - how do I? . . .
You can put it in the Catalog, Toolbar or assign a shortcut.otis_lewd wrote:This worked:
$f1 = getinfo("SelectedItemsPathNames", ""); focus PI; $f2 = getinfo("SelectedItemsPathNames", ""); openwith "C:\Program Files\Compare It!\wincmp3.exe" "$f1" "$f2";
Now I just have to figure out where to put it so I can call it.
Re: Manage User-defined Commands - how do I? . . .
Okay, I put the following in the SCRIPT textbox in the Manage User-Defined Commands form under the RUN SCRIPT category:
$f1 = getinfo("SelectedItemsPathNames", ""); focus PI; $f2 = getinfo("SelectedItemsPathNames", ""); openwith "C:\Program Files\Compare It!\wincmp3.exe" "$f1" "$f2";
It seems to work.
Thank you for all your help.
$f1 = getinfo("SelectedItemsPathNames", ""); focus PI; $f2 = getinfo("SelectedItemsPathNames", ""); openwith "C:\Program Files\Compare It!\wincmp3.exe" "$f1" "$f2";
It seems to work.
Thank you for all your help.
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Manage User-defined Commands - how do I? . . .
@otis_lewd:
If you are a registered user, since today you can use:
If you are a registered user, since today you can use:
Code: Select all
$f1 = <get item 1>;
$f2 = <get item 2>;
openwith "C:\Program Files\Compare It!\wincmp3.exe" "$f1" "$f2";
XYplorer Beta Club