Correct syntax in user command: Help

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
User avatar
admsupport
Bronze Member
Bronze Member
Posts: 142
Joined: 2008 Dec 11, 00:18
Location: Japan

Correct syntax in user command: Help

Post by admsupport »

Hello

I wanted to save this command I use in the Script wizard (Ctrl+B) for re-use

Template:

Code: Select all

copy "$N" "sample $01.$E", del "$N"
Now, below is the way I have recorded it and the error message when I run it:

Copied as a user command
Description:

Code: Select all

$ copy "$N" "sample $01.$E", del "$N"
When I run it:

in the DOS address bar:
copy "Model Room 01.jpg" "Sample $01.jpg", del "Model Room 01.jpg" (so it should be fine?)

but in the dos window:
The syntax of the command is incorrect.

Is it a bad syntax in the description field?
User avatar
nikos
Site Admin
Site Admin
Posts: 15892
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

while in ctrl+B, press the preview button and see what the command to be executed looks like, this will give you the hint
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

Don't include "$" in the Script Wizard, as it is implied by the 'execute (DOS)' already.
Multiple commands separated by a comma don't work for the addressbar.
User avatar
admsupport
Bronze Member
Bronze Member
Posts: 142
Joined: 2008 Dec 11, 00:18
Location: Japan

Post by admsupport »

Sorry, I rephrase it is not about SCRIPT WIZARD but about a USER COMMAND syntax:

I run this command IN the script wizard fine (first part of my post).

But I cannot run it when I record it as a USER COMMAND (see the end of my post, second CODE)

How do I have to record it?

I have tried many ways with $, without, everythime I have the same error message.
Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant »

You cannot use the multiple commands syntax for that.
User avatar
admsupport
Bronze Member
Bronze Member
Posts: 142
Joined: 2008 Dec 11, 00:18
Location: Japan

Post by admsupport »

Mr.Pleasant wrote:You cannot use the multiple commands syntax for that.
Okay I start to understand. I can only record ONE single command in the user commands on the Customize menu. When I try the following ("ren" instead "copy" + "del") that works, however the "$01" does not change?

Code: Select all

$ ren "$N" "Sample $01.$E"
The original file name "Text 2009.doc" was renamed "Sample $01.doc" but not "Sample 01.doc" as I expected.

Of course, I can do that using F2 (the renaming function), but I try to understand the user commands and the correct syntax to record them
User avatar
nikos
Site Admin
Site Admin
Posts: 15892
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

from the addressbar commands go only to the focused item, so even if you have 10 items selected only one will be treated. That's why counters like $01 don't make sense in this context, they are only for ctrl+B command scripts

having said that the latest v1.72 can apply the command to multiple selected files if you start it by $$ or >>
User avatar
admsupport
Bronze Member
Bronze Member
Posts: 142
Joined: 2008 Dec 11, 00:18
Location: Japan

Post by admsupport »

nikos wrote: having said that the latest v1.72 can apply the command to multiple selected files if you start it by $$ or >>
Thanks for the explanation, a double "$" or ">" was what I was missing. The explanation in the pdf manual makes sens now :idea:

And yes about CTRL+B, but I wanted to save a command for re-use.
Post Reply