History to minitree saving

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zakhar
Posts: 148
Joined: 08 Sep 2010 21:13

History to minitree saving

Post by zakhar »

Hello, XYplorer Club!

My question is as follows:
Under a minitree turned on I would like to save a current minitree position (not only the <curpath> but also include all other folders, that
were visited during this session too upd1: not only visited this session but also folders that are represented in this minitree:upd1) to a temporary text file to use it in future by rebuilding the minitree after doing some other things.
And I found no way to do that as there is no way to retrieve session history by a script command.
Of course I do not want to solve this by any options like saving session - only scripting must be sufficient.

Have someone an idea how could it be worked around?

Thanks.

zakhar
Posts: 148
Joined: 08 Sep 2010 21:13

Re: History to minitree saving

Post by zakhar »

Commands "Set as favorite minitree"\"Load favorite minitree" do what I meant in my first post -
- except script ready path retrieving... :cry:

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: History to minitree saving

Post by SkyFrontier »

Code: Select all

if (<cc_isfolder> == 1) { writefile("c:\logs\XYlog.txt", "<curpath><crlf>", a); }

perm $cp; $cp = "<cc_path>"; if("<cc_path>" == "$cp") { writefile("c:\logs\XYlog.txt", "<curpath><crlf>", a); $cp = "<cc_path>"; } else { }

perm $cp; $cp = "<cc_item>"; if("<cc_item>" == "$cp") { writefile("c:\logs\XYlog.txt", "<curpath><crlf>", a); $cp = "<cc_item>"; } else { }

perm $cp; $flag = 1; $cp = "<cc_item>"; if("<cc_item>" == "$cp") { if ($flag == 1) { writefile("c:\logs\XYlog.txt", "<curpath><crlf>", a); $cp = "<cc_item>"; } else { $flag = 0; } else { }

perm $cp; $flag = 1; $cp = "<cc_item>"; if("<cc_item>" == "$cp") { if ($flag == 1) { writefile("c:\logs\XYlog.txt", "<curpath><crlf>", a); $cp = "<cc_item>"; $flag = 0; } else { $flag = 0; } else { }

Hello, Zakhar.
I was into your issue but had nothing conclusive to pop with, so sorry for not answering earlier.

The above custom column scripts are attempts to log path navigation, each line being one attempt. It's abusive, I know, but it currently seems to be the only way to emulate CEA so some sort of logging is somehow doable.

Some notes I'd like other people to read and drop a thought about to so we may come up with something:

How to prevent each item at the list triggering the script, ie, force a single entry being written into the log? Is it possible to force a single item to be triggered?

Is it possible that 'Path Change' could trigger a script? The only way around here is to permanently have a script running in background, which I find potentially dangerous.

Script access to individual tabs' history as well as globally would help a lot, here.

text gettoken(get("list_recentlocations"), count, <crlf>); //49 entries - is that all we have???

'Step mode' is not interfering on CC anymore? It should!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

zakhar
Posts: 148
Joined: 08 Sep 2010 21:13

Re: History to minitree saving

Post by zakhar »

Hello, SkyFrontier!
I was into your issue but had nothing conclusive to pop with, so sorry for not answering earlier.
I am glad to see your answer and I will surely follow the discussion (if any occurs) here with interest. :)
Script access to individual tabs' history as well as globally would help a lot, here.
- that is what I think too.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: History to minitree saving

Post by highend »

@SkyFrontier

But what is wrong with

Code: Select all

get("list_recentlocations");
in this context?
One of my scripts helped you out? Please donate via Paypal

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: History to minitree saving

Post by SkyFrontier »

Hi there, highend.

AFAICT 64 is the maximum number of folders supported by get(), which is very, very low. MiniTree seems to have no limits (granted I am not a heavy user of it [I should be!]), which kind of defeats the usage of get() in face of a really meaningful history. For instance one can think that 100 entries for undo is a great thing - my personal usage drove me to using 2 or 3 XY instances as some important 'undo' often went swallowed by several rename operations performed by script (which in turn leads to think: why not having those massive operations totally ignored by undo, since it's that low-limited?).

So if we are talking about a meaningful history tracking, the design is just not enough. That's why I'm in a long time quest for a better navigation tracking,

Not to mention the OP request: "include all other folders, that were visited during this session too". 64 will NEVER cover a busy session, in that case!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: History to minitree saving

Post by highend »

Ah, ok. I didn't know that there is a hard limit. Thanks!
One of my scripts helped you out? Please donate via Paypal

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: History to minitree saving

Post by autocart »

SkyFrontier wrote:Some notes I'd like other people to read and drop a thought about to so we may come up with something:

How to prevent each item at the list triggering the script, ie, force a single entry being written into the log? Is it possible to force a single item to be triggered?
Hi Sky,
If I understand correctly that it does not matter which item specifically triggers the cc script, then it kind of could be done with

Code: Select all

if (get("CountItems") == 1) {
  .... code ...
}
Of course this script does get triggered for each item but for all other items besides the first item generated in the list, it does nothing but check the if clause. I don't know if this is fast enough or if it at all comes close to what you are looking for. Besides, it works only with the trigger "Browse" but not with "List" and ofc not with "Click" either.

Regards, S.

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: History to minitree saving

Post by autocart »

and ofc, regarding logging path navigation with such a work around, I assume u are aware of the fact that CCs only get triggered in details view but e.g. not in thumbnails view (unless I am completely mistaken).

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: History to minitree saving

Post by SkyFrontier »

Thanks, autocart!
(S...? Stephen? Sorry, can't remember your name!)

Yet it fails on empty folders (they are very meaningful to me), it's better to have a half-baked something than be plenty of nothing. For the time being. Thanks much!

Zakhar:

So you'll need to create a custom column for the logging part:
//LOGGER: type: script, format: text, trigger: browse, item type: files and folders; fails on empty folders

Code: Select all

if (get("CountItems") == 1) { writefile("c:\logs\XYlog.txt", "<curpath><crlf>", a); }

...and to run the following script which, on each run, will perform a little maintenance too, trimming "XYlog.txt" to the recent X items, everything else stored at a backup file (which currently lacks any way of verification - my experience tells me such kind of file deserves proper checking with large-files editors, like editPad; perhaps you may add a simple file size alert here?), then will build a miniTree added with such recent items.
Please state what else you may need and I'll see what I can do (for now I'm leaving your other requirements behind as they sound repetitive).

"retrieve session history by a script command"
Well... as you may followed, the options are pretty limited so far.

Code: Select all

//you may want to adjust these values
   $maxRecents = "50";
   $log = "c:\logs\XYlog.txt";

   $cnt = readfile("$log");

   $tst = gettoken(trim("$cnt", "<crlf>"), count, "<crlf>");
   if($tst > $maxRecents) {

   $old = gettoken("$cnt", $maxRecents+1, "<crlf>", , 2);
   $rec = gettoken("$cnt", $maxRecents, "<crlf>", , 1). "<crlf>";
   writefile("$log", "$rec");
   writefile(gpc("$log", path) . "\" . gpc("$log", base) . "_BACKUP." . gpc("$log", ext), "$old", a);
   $rec = trim("$rec", "<crlf>");

                          }

   else { $rec = trim("$cnt", "<crlf>"); }

   $tree = get(#489);
   if($tree == 1) {   }
   else { #489; }
   loadtree replace($rec, "<crlf>", "|"), 1;

   echo "MiniTree updated!";
   
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

zakhar
Posts: 148
Joined: 08 Sep 2010 21:13

Re: History to minitree saving

Post by zakhar »

I thank all who have tried to found a solution!
Well... as you may followed, the options are pretty limited so far.
I understand, and it is not a real trouble against the background of the other wide operational capabilities of XYplorer.

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: History to minitree saving

Post by autocart »

right, empty folders (did not think of that) & views which do not show custom columns at all will fail.

what about the tweak PFADefaultOpenFolders, though?
viewtopic.php?f=3&t=14417
can this be used?

yes, it is Stephan :-)

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: History to minitree saving

Post by SkyFrontier »

Hello, StePHAn! (I was afraid I was confusing you with Stefan), sorry for the blank...

My current toDo for this is as follows:
unique items when trimming\use while loop, tree from recent+get\recent+curtabs, check size of backup

No ETA, tho. Will publish on demand.
Thanks for the tip, I'll check it out today - while the miniTree application may not be my suit, the logging part is of a great, huge interest, and your idea was the best thing I had so far (> 5 yrs!), that's why I am so thankful!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: History to minitree saving

Post by autocart »

SkyFrontier wrote:Hello, StePHAn! (I was afraid I was confusing you with Stefan), sorry for the blank...
...
Thanks for the tip, I'll check it out today -
...
and your idea was the best thing I had so far (> 5 yrs!), that's why I am so thankful!
Before u did write it with "ph". That's close enough. Only an "f" I consider as a misspelling. But you have a good memory anyway. Thx for the concern.

Also thx for the friendly feedback. Glad, I could help.

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: History to minitree saving

Post by SkyFrontier »

Well...

PFA for folders (despite being an old wish o'mine) sounds like black magic on file management to me, yet I'm inclined to implement this for the sake of the logging personal project - which will include timestamping! :ghost:

//pfa: "\>::writefile("C:\logs\XYlog.txt", "<pfaitem><crlf>", a); goto <pfaitem>;"
Observations so far:
pfa: won't retrieve mouse triggered tab changes; neither via backspace as well; depends on a tweak: PFADefaultOpenFolders; does empty folders;
custom column: occupies a valuable column just for this; ignores empty folders;
-combination of both will produce duplicates (which enforces the usage of a dedupe code at the trimming part...)

p.s.: I still recall I'd like a way to automatically process >=2 existent PFA entries if all have indications to allow that. For instance (not actual cases!), one entry being set to log, another to color-code under certain conditions and a third one opening a 3rd party tool if/when a certain folder is entered: PFA design already allows setting/unsetting by (un)ticking boxes, so why not allowing all possible actions being executed sequentially, order being user defined by what already is?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply