Multi Commander > Script

Search routine

<< < (2/8) > >>

Ulfhednar:
Continuing my rename & SAR experiments, I'm wondering about regex to MC script transposition.
e.g.
Number & space to number & '.'
((?:[0-9]+)+)\
\1.

I'm stealing Jungles earlier code & using a . :-
$n = StrRegExpFind( $s, ".?\d+$" );

& I've just realized I appear to need to define a button to run this or is there a field I'm missing/misusing that allows me to run a script on a selected file/folder.  Is there a script input window & if not, can I have one to play with in a future build?  :D

Mathias (Author):

--- Quote from: Ulfhednar on July 30, 2013, 19:20:25 ---Continuing my rename & SAR experiments, I'm wondering about regex to MC script transposition.
e.g.
Number & space to number & '.'
((?:[0-9]+)+)\
\1.

I'm stealing Jungles earlier code & using a . :-
$n = StrRegExpFind( $s, ".?\d+$" );

--- End quote ---
?.. in regexp \d means any digit.. or what are you asking ?


--- Quote from: Ulfhednar on July 30, 2013, 19:20:25 ---& I've just realized I appear to need to define a button to run this or is there a field I'm missing/misusing that allows me to run a script on a selected file/folder.  Is there a script input window & if not, can I have one to play with in a future build?  :D

--- End quote ---
I don't understand..  You can assign a HotKey , Menu button . Button Panel Button and more for any script command you create.. there are 3 buttons to the right in the User command.  where you create the command.  you can not miss it . :)

Ulfhednar:
Thanks for responding Mathias.

I was thinking my regex would be replaced by the modified string by Jungle.  But I don't think it targets spaces.
ie
1 2 3 4
to
1.2.3.4

I wanted to test it & edit (as with a sandbox), before creating a button (that didn't work several times!) - short on time... 
Just wanted to select a file/folder, run the script & if good then assign it a button.  Maybe the debugger does this & I haven't figured out how?

I thought there was something like a script test window, (maybe I recall something like that from XYplorer which I tried years ago?)
But I have just looked at my toolbar - the User Commands item shown on MC homepage is not visible!  ???  See attached
So maybe I am missing it!!  :)

Mathias (Author):

--- Quote from: Ulfhednar on July 31, 2013, 13:05:59 ---Thanks for responding Mathias.

I was thinking my regex would be replaced by the modified string by Jungle.  But I don't think it targets spaces.
ie
1 2 3 4
to
1.2.3.4

--- End quote ---
Not sure about regexp.  But if you want to replace all space with "." then you can do

$s = StrReplace( $s, " " , "." );


--- Quote from: Ulfhednar on July 31, 2013, 13:05:59 ---I wanted to test it & edit (as with a sandbox), before creating a button (that didn't work several times!) - short on time... 
Just wanted to select a file/folder, run the script & if good then assign it a button.  Maybe the debugger does this & I haven't figured out how?

--- End quote ---
You have the MultiScript debugger under the help menu.


--- Quote from: Ulfhednar on July 31, 2013, 13:05:59 ---But I have just looked at my toolbar - the User Commands item shown on MC homepage is not visible!  ???  See attached

--- End quote ---
(Think you forgot to upload the attachment.)
The images on the webpage can be old. the UI might have updated.

Ulfhednar:
Thanks Mathias
The screen of my tool bar is posted - it shows the 'user commands' menu element is absent on my UI.  Can you not see it?

How do I make the debugger run a script on a file/folder to test the script? 
I need a window that allows me to run a script 'live' if you see what I mean. 

If I understand correctly I must -

* create a button,
* test it,
* then, if wrong, edit it. 

That is a lot of clicking around the dialogs so I would like a sandbox. (If it doesn't already exist in some form).

If I understand your advice, my script should be

$s = StrReplace( $s, " " , "." ?\d);

But it doesn't seem to work..  :-[


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version