What am I doing wrong in custom commands?

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

sanferno
Silver Member
Silver Member
Posts: 288
Joined: 2013 Nov 30, 18:40

What am I doing wrong in custom commands?

Post by sanferno »

What a week, first DR problem, now custom command is driving me nuts!

I have a custom command that launch this order for DesktopRules: >C:\Program Files\zabkat\Desktop (search) rules\deskrule.exe $P
Now, for other reasons, I'm trying to set up a new one for a C# project but I can't make it work: >T:\Temp\Broza\xConso.exe $P

On cmd works ok, but not over x2. Any suggestion?

Thanks
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Re: What am I doing wrong in custom commands?

Post by FrizzleFry »

If T:\Temp\Broza\xConso.exe is a console command, you should do
$T:\Temp\Broza\xConso.exe "$P"

Do the folders have spaces in their names? If so, you should use quotes: "$P"

I would also put quotes around the command since that path has spaces
>"C:\Program Files\zabkat\Desktop (search) rules\deskrule.exe" "$P"
sanferno
Silver Member
Silver Member
Posts: 288
Joined: 2013 Nov 30, 18:40

Re: What am I doing wrong in custom commands?

Post by sanferno »

Thanks, FrizzleFry, that seems to fix the problem. :)
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: What am I doing wrong in custom commands?

Post by Kilmatead »

To clarity (for others who may be reading), note in his example that Frizzle used a '$' at the start of the line, instead of a '>'. The former is for DOS/CMD/StdOut programmes, the latter for Windows/GUI.

The same commands may be typed into the addressbar as well (tokens and all), which can be a quick and convenient way of checking what works and what doesn't without constantly re-editing a user-command through the menus as trial and error.
sanferno
Silver Member
Silver Member
Posts: 288
Joined: 2013 Nov 30, 18:40

Re: What am I doing wrong in custom commands?

Post by sanferno »

For some reason with my custom program that seems to works randomly.

If I run this: >"T:\Temp\Programas\Utilidades PC\Herramientas_x2\NuevaGDB.exe" "$P"
The command takes the path argument sometimes, but others don't.

If I force the orden like this: >"T:\Temp\Programas\Utilidades PC\Herramientas_x2\NuevaGDB.exe" "T:\Temp\Broza"
The command works always.

This doesn't happend running, e.g.: >"C:\Program Files\zabkat\Desktop (search) rules\deskrule.exe" "$P"

Why? Is my program weird? is it some nasty .NET thing?
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: What am I doing wrong in custom commands?

Post by Kilmatead »

You'll have to be a little more specific. The $P token returns the path of the "last" currently selected item - from a normal pane, that will almost always mean the path of the pane itself (if there are no files in the current pane, then $P will be blank). Also note that it may contain a CLSID if you're browsing "My Computer", etc, instead of a normal path.

Remember too that $P is only the "path" to the item, not the full path of the item itself, so if you select a folder, you will only return the "parent" of that folder, not the entire folder path.

In the case of scrap containers, if no items are selected it will return the path of the last active proper x2 pane (if one exists). If multiple items are selected, as I mentioned above, the path of the last item will be returned.

To process multiple selections, or to return the actual names of items themselves (not just a single path), use other tokens, such as $A, etc. and be sure your programme can handle multiple parameters.

It may be helpful if you created yourself a small dummy programme or script which just prints back any/all command-line items fed to it - that way you can get a better idea of exactly what each token may return, and how best to choose the right one for what you want.
sanferno
Silver Member
Silver Member
Posts: 288
Joined: 2013 Nov 30, 18:40

Re: What am I doing wrong in custom commands?

Post by sanferno »

Kilmatead wrote:The $P token returns the path of the "last" currently selected item - from a normal pane, that will almost always mean the path of the pane itself (if there are no files in the current pane, then $P will be blank).
That was totally the thing. I was inside an empty folder.
I've created a test folder there in order to have something inside and now it works.

Thanks Kilmatead, and also for your patience :beer:
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: What am I doing wrong in custom commands?

Post by Kilmatead »

sanferno wrote:...and also for your patience
All I ask in return is that I be allowed to go off-topic on my wild tangents of imaginary abandon from time to time. :D That seems a fair trade to me. Too much concision, accuracy, and single-minded devotion is great for answering questions, but it's terribly bad for the human soul in general. :wink:
sanferno
Silver Member
Silver Member
Posts: 288
Joined: 2013 Nov 30, 18:40

Re: What am I doing wrong in custom commands?

Post by sanferno »

You are right, though your "off-topic" could be sometimes difficult to understand for non-native english speakers like this sinner. :wink:
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: What am I doing wrong in custom commands?

Post by Kilmatead »

When it all becomes too much, just lie back and think of what would have happened if Cervantes had mescaline to play with, and you'll at least be in the same ballpark. :D He knew all about eschewing reason in order to properly nourish the soul - where would Western languages be without his flights of fancy?
User avatar
drac
Bronze Member
Bronze Member
Posts: 145
Joined: 2013 Jan 08, 00:14

Re: What am I doing wrong in custom commands?

Post by drac »

I am sure that native English speakers also have trouble understanding Kilmatead's literary references - so you are not alone, sanferno. But I take them as a challenge - something to be discovered - and go to Google and start tracking down all the obscure names and phrases. Eventually I (usually) can get at least close to grasping (though not necessarily understanding) what Kilmatead was saying (though not necessarily meaning) in his comments. It is like being in the presence of Plato or Aristotle - I know they are saying something very profound but it is up to ME (the listener or, in this case, reader) to figure it out.
sanferno
Silver Member
Silver Member
Posts: 288
Joined: 2013 Nov 30, 18:40

Re: What am I doing wrong in custom commands?

Post by sanferno »

where would Western languages be without his flights of fancy?
Lost in time, like tears in the rain... but it's not time to die already yet! :)
Robert2
Gold Member
Gold Member
Posts: 671
Joined: 2004 Jun 17, 15:39

Re: What am I doing wrong in custom commands?

Post by Robert2 »

Kilmatead’s prose needs to be indulged with the same childlike abandon that is required to read James Joyce’s Ulysses. An obvious Irish connection…
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: What am I doing wrong in custom commands?

Post by Kilmatead »

drac wrote:I know they are saying something...
Profound? I think not. De Profundis is one of those seriously overused phrases which imposes itself more upon the vanity of the listener than the probity of the source itself. We silly humans love to keen within depths of the lesser-known, and embrace the emptiness of our own shame when there is nothing else to hold on to. Ironically it's precisely that which makes us so disposable, like the man who loses sight of the shore and cares not for the wind at hand, though he be its very servant.

Profundity is easy to fake - it's the first thing you learn in bogus creative writing classes from people who know the mien of the craft yet don't understand one whit of what it's actually good for... "Write about what you know," they'll pontificate, "write from within." Well, I think not. Follow the screaming from Byron to Botticelli, Bacon to Boismortier, no matter which way you spin them you're only at the beginning of the alphabet with no end of the cacophony in sight. Would that we trade that vanity for our pride, that humility for our purpose - use the simple rhythmic intermingling iterations of people's slight grasp of their own emotions and cage it within a context of clever wordsmithing - yea, we begin to see the party of the lie.

This stuff is not profound, dude, it's fun. It's a cruel form of entertainment where the writer begs to be slain by his own pen - yet that's what they all do, day after day, hour after hour, transmuting syncopations into psychopathy using a medium of poor human linguistics. It's well know that the last bit of profundity-in-the-making died on June 26, 363 AD, in Samarra, Iraq. This century (and the last) never had a hope of producing even a glimmer of the like to swagger amongst our befuddled midst. That we should like the calendrical play on words only permits the poverty of the profound itself; it does not permit us the genius to proclaim anything but our own shallowness - and to suffer the public doubts of a heresy therein.
sanferno wrote:Lost in time, like tears in the rain...
See? He gets it: paraphrasing Blade Runner to counter the mate and bane of Shakespeare! What more is there to say? :D
Robert2 wrote:An obvious connection…
Yeah, and no one ever finished his nonsensical ramblings either! Everyone started reading that horrid tome of a mad streetmap, but find me one man in Dublin who ever finished it, and I'll show you the lie and spirit of a land so lost up its own myth that a drink proclaimed be a drink declaimed, and nothing but its own relief. :wink: (How funny that is depends on how far you got into the book before abandoning it for a chill bay breeze and a plate of toasted soldiers. Or something like that... I'll be the first to admit that my heart was unprepared for just how beautiful severity itself could be, and she crushed me poor soul about near 10-pound lighter than the shilling I paid to sight her in the first place.)
Robert2
Gold Member
Gold Member
Posts: 671
Joined: 2004 Jun 17, 15:39

Re: What am I doing wrong in custom commands?

Post by Robert2 »

Believe it or not, James Joyce’s Ulysses and William Faulkner’s The Sound and The Fury were my two favorite readings in my early twenties. I read each of them three times! Voluptuously! I went on to read most of their other works, but none gave me as much enjoyment as the major two. When I first read Ulysses, I had an “epiphany” that it was the kind of book I had always wanted to read and never dared to ask…
Have a nice Bloomsday!
Post Reply