Stupid macro? question

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
tbolick
New Member
Posts: 4
Joined: 2020 Nov 15, 05:46

Stupid macro? question

Post by tbolick »

macros look interesting, and yet I can't even do a SIMPLE one. I want a one button "rename this file to a specific name". Basically, whatever file I am on, just rename it to DONE.txt. The fancier version would be to find the file named log.txt in that folder and rename it to DONE.txt. But darn, this is beating me up. I tried to record it, then I couldn't get it to save. (well, I pressed save, gave it a name, and the windows didn't close, so I pressed the X and the could not find it again.) Finally got that to kinda work somehow, but then it errors when I tried to run it. It runs fine in Debug. It's not like I haven't been coding since punch cards, so I should be able to get this stupid task done!
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Stupid macro? question

Post by nikos »

I recommend using the macro recorder. For easier operation for the rename task, don't press F2 but use FILE > CHANGE TYPE menu command, which opens a separate dialog window. Then, once you are sure the macro works as expected, click SAVE from the macro editor, supply a name, THEN RUN OR DEBUG the macro, so that the "save" sticks. If you don't want to run it fully, click DEBUG button then cancel the execution.

then it will appear in the CUSTOMIZE menu and you can add it on a toolbar etc. For more information see the macro demo videos in the documentation.

btw the macro you are trying to create looks something like this

Code: Select all

COMMAND 32902
WAITWND
POP 0
FINDCLASS Edit
SETTEXT "DONE.txt"
OK
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Stupid macro? question

Post by nikos »

for more details see the demo video
https://m.facebook.com/story.php?story_ ... 7877776758
tbolick
New Member
Posts: 4
Joined: 2020 Nov 15, 05:46

Re: Stupid macro? question

Post by tbolick »

Ah, I had not understood the run/debug to have name "stick".

How much more programmability does the Ultimate version have (vs Pro)? I'd like a column that says in this folder the folder with the latest mod date has the file done.txt in it. Doable?
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Stupid macro? question

Post by nikos »

you can use the programmable column for all sorts of things like that, although i'm not sure exactly what you want. Detecting if a folder has DONE.TXT inside it is easy, and you could even do it with the CONTENTS [S] column in your professional version. Just replace the generic * filter (using ADVANCED OPTIONS, search for szFileCountRule in REGISTRY.TXT file) with "done.txt", then the counter will be 0 for folders that don't have the file
tbolick
New Member
Posts: 4
Joined: 2020 Nov 15, 05:46

Re: Stupid macro? question

Post by tbolick »

Ah, but this is where it gets hard/fancy:

folder structure:
Update1-->PC21->RUNNING.TXT
-->PC05->STOPPED.TXT
-->PC11->DONE.TXT

Update2-->PC55->DONE.TXT
-->PC23->STOPPED.TXT
-->PC34->DONE.TXT

The top level is the UpdateX folder, the second level PCXX is in date/time order. How can I tell Update1 from Update2 (i.e. which one has the most recent folder (modification) has DONE.TXT in it. I'd like to somehow indicate this is TRUE for Update2 but FALSE for Update1.

Probably asking for too much, but you can ask, right?

Tom...
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Stupid macro? question

Post by nikos »

you are asking a bit too much :)
the contents column can only work one level down, not 2 levels like you're after

sometimes a change of perspective is required. FOr example, why do you need file markers for your (whatever it is you're doing)?
have you considered a different procedure e.g. color tag folders you are still "working on" with red or something?
www.zabkat.com/blog/color-tag-files-v35.htm
Post Reply