topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 8, 2024, 6:26 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: ControlZ x times  (Read 20508 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
ControlZ x times
« on: September 06, 2020, 09:49 AM »
In pspad I have the option to undone the last change with control+z as usual.
I change a file very often and the backup is not useful I think. Besides may be an answer to several programs. Include Microsoft Word.

Can I have an AHK script to go back or undone in the opened file x times ? Do and undone with flexibility is better because we don't know how many keystrokes control+z are necessary until reach the target...

 :-* :P

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #1 on: September 06, 2020, 02:04 PM »
Undo/Redo support can only effectively be built into the software that is used/meant to work on a filetype. No way of adding that externally, other than implementing a local git repo and committing every change, and that is quite impractical.
This is also the reason the way Undo/Redo is implemented differently in different software, as not all file formats are maintained equally (flexible) in memory, by the matching software.

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,939
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #2 on: September 06, 2020, 03:17 PM »
The versioning built into Microsoft Office....it isn't that useful. Not after you have experienced what real versioning functionality (backed by a decent versioning software like Git, Mercurial, SVN or even the venerable CVS and RCS) can do. Especially with text-based file formats (like .txt, .adoc, .md, .php, .c, .bat etc.) this works amazingly, once you get your head around the workflows such systems demand. However, for binary blob file formats (like .docx, .xlsx, .pdf, .png, .jpg etc.) such software is barely usable.

Still, Ath is completely right in stating that such functionality is major overkill for simple Undo's (Control + Z).

Yet the text
Do and undone with flexibility is better because we don't know how many keystrokes control+z are necessary until reach the target...
indicates to me that Contro might actually be in the market for a full versioning system. Git is free to download for Windows, Linux and Mac. And there are many free and/or open source Git clients available. Fork, GitExtensions, TortoiseGit etc. allow you to work much easier with the Git versioning system. You could even implement a web-interface for Git. One the more (in)famous ones is GitLab (Linux only!). Gitea is simpler to setup and maintain. It is also much more resource-friendly when compared with the GitLab software.

All of the above does require a good read of the installation instructions and Git clients come with their own manuals as things can get complicated quickly. A good grasp of concepts is essential before embarking on this route. Yet, if you mainly work with binary blob file formats, setting up a versioning system will be almost for nought anyway. But, as Contro mentioned in his post, he was working with PsPad, which is an editor for text-based file formats, so going for a Git setup might prove useful.

Git clients usually have a differential viewer built into them. So it is pretty easy to see the which file is needed to step back to. And if you are not satisfied with those differential viewers, you can get better ones for free as well. WinMerge would be one of the options. Git clients are familiar with this one and send the content you wish to review directly to that software without human interaction. Software like WinMerge also have more/better features for editing and marking differences between files. 
« Last Edit: September 06, 2020, 03:26 PM by Shades »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #3 on: September 07, 2020, 12:37 AM »
indicates to me that Contro might actually be in the market for a full versioning system.
Well, yes and no. Knowing the OP for a while tells me that this is way overcomplicated for the use he has, as for each change to be 'recorded' so it can be reverted, it needs to be committed, and my interpretation of his request, it seems that he would expect it 'as you type', like a built-in undo/redo, and not introduce extra keys to press or mouse-clicks to make.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #4 on: September 07, 2020, 04:30 AM »
indicates to me that Contro might actually be in the market for a full versioning system.
Well, yes and no. Knowing the OP for a while tells me that this is way overcomplicated for the use he has, as for each change to be 'recorded' so it can be reverted, it needs to be committed, and my interpretation of his request, it seems that he would expect it 'as you type', like a built-in undo/redo, and not introduce extra keys to press or mouse-clicks to make.
Probably. (Although the request is very unclear.)
Filehamster could be an option. It appears to be in development (again). Also requires active input, but iiuc is a lot simpler than full versioning system.
Tom

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #5 on: September 07, 2020, 05:35 AM »
indicates to me that Contro might actually be in the market for a full versioning system.
Well, yes and no. Knowing the OP for a while tells me that this is way overcomplicated for the use he has, as for each change to be 'recorded' so it can be reverted, it needs to be committed, and my interpretation of his request, it seems that he would expect it 'as you type', like a built-in undo/redo, and not introduce extra keys to press or mouse-clicks to make.
:-\ You are wrong. Ask me and you will know. Is the way to try to help. If not you are not a helper.  :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #6 on: September 07, 2020, 05:41 AM »
The versioning built into Microsoft Office....it isn't that useful. Not after you have experienced what real versioning functionality (backed by a decent versioning software like Git, Mercurial, SVN or even the venerable CVS and RCS) can do. Especially with text-based file formats (like .txt, .adoc, .md, .php, .c, .bat etc.) this works amazingly, once you get your head around the workflows such systems demand. However, for binary blob file formats (like .docx, .xlsx, .pdf, .png, .jpg etc.) such software is barely usable.

Still, Ath is completely right in stating that such functionality is major overkill for simple Undo's (Control + Z).

Yet the text
Do and undone with flexibility is better because we don't know how many keystrokes control+z are necessary until reach the target...
indicates to me that Contro might actually be in the market for a full versioning system. Git is free to download for Windows, Linux and Mac. And there are many free and/or open source Git clients available. Fork, GitExtensions, TortoiseGit etc. allow you to work much easier with the Git versioning system. You could even implement a web-interface for Git. One the more (in)famous ones is GitLab (Linux only!). Gitea is simpler to setup and maintain. It is also much more resource-friendly when compared with the GitLab software.

All of the above does require a good read of the installation instructions and Git clients come with their own manuals as things can get complicated quickly. A good grasp of concepts is essential before embarking on this route. Yet, if you mainly work with binary blob file formats, setting up a versioning system will be almost for nought anyway. But, as Contro mentioned in his post, he was working with PsPad, which is an editor for text-based file formats, so going for a Git setup might prove useful.

Git clients usually have a differential viewer built into them. So it is pretty easy to see the which file is needed to step back to. And if you are not satisfied with those differential viewers, you can get better ones for free as well. WinMerge would be one of the options. Git clients are familiar with this one and send the content you wish to review directly to that software without human interaction. Software like WinMerge also have more/better features for editing and marking differences between files. 
I am not versioning. I have a txt file with lines to be introduced in another program.
If I make a mistake and fails introducing one line or several and after continue adding more lines to the txt file I will have to recover the accidentally omitted line. Usually when I revise the txt file I delete the lines I think I have introduced. sometimes I make the mistake and continue adding lines after deleted the supposed introduced ones....

 :-* :P


Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #7 on: September 07, 2020, 05:44 AM »
indicates to me that Contro might actually be in the market for a full versioning system.
Well, yes and no. Knowing the OP for a while tells me that this is way overcomplicated for the use he has, as for each change to be 'recorded' so it can be reverted, it needs to be committed, and my interpretation of his request, it seems that he would expect it 'as you type', like a built-in undo/redo, and not introduce extra keys to press or mouse-clicks to make.
Probably. (Although the request is very unclear.)
Filehamster could be an option. It appears to be in development (again). Also requires active input, but iiuc is a lot simpler than full versioning system.
:-\

Very interesting....

The answer from pspad may be...... use editorCommand() function and call undo as many time as you need



File scripting.rtf in the pspad folder or pspad helo

Command ecUndo or ecRedo

 :-* :P

Note : unfortunately I have not the basis to understand the above option or put in practice.
 :(

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #8 on: September 07, 2020, 05:52 AM »
The versioning built into Microsoft Office....it isn't that useful. Not after you have experienced what real versioning functionality (backed by a decent versioning software like Git, Mercurial, SVN or even the venerable CVS and RCS) can do. Especially with text-based file formats (like .txt, .adoc, .md, .php, .c, .bat etc.) this works amazingly, once you get your head around the workflows such systems demand. However, for binary blob file formats (like .docx, .xlsx, .pdf, .png, .jpg etc.) such software is barely usable.

Still, Ath is completely right in stating that such functionality is major overkill for simple Undo's (Control + Z).

Yet the text
Do and undone with flexibility is better because we don't know how many keystrokes control+z are necessary until reach the target...
indicates to me that Contro might actually be in the market for a full versioning system. Git is free to download for Windows, Linux and Mac. And there are many free and/or open source Git clients available. Fork, GitExtensions, TortoiseGit etc. allow you to work much easier with the Git versioning system. You could even implement a web-interface for Git. One the more (in)famous ones is GitLab (Linux only!). Gitea is simpler to setup and maintain. It is also much more resource-friendly when compared with the GitLab software.

All of the above does require a good read of the installation instructions and Git clients come with their own manuals as things can get complicated quickly. A good grasp of concepts is essential before embarking on this route. Yet, if you mainly work with binary blob file formats, setting up a versioning system will be almost for nought anyway. But, as Contro mentioned in his post, he was working with PsPad, which is an editor for text-based file formats, so going for a Git setup might prove useful.

Git clients usually have a differential viewer built into them. So it is pretty easy to see the which file is needed to step back to. And if you are not satisfied with those differential viewers, you can get better ones for free as well. WinMerge would be one of the options. Git clients are familiar with this one and send the content you wish to review directly to that software without human interaction. Software like WinMerge also have more/better features for editing and marking differences between files. 
Ow. The versioning inside word.

I use that in my projects to control changes. It's a nice idea.

But my problem now is in pspad.
I can use the backup copies, but if the change are quick and often sometimes I lose the control....

so I need to go back and forward quickly because is not confortable apply many control+Z combinations to arrive to the desired point....

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #9 on: September 07, 2020, 05:54 AM »
Undo/Redo support can only effectively be built into the software that is used/meant to work on a filetype. No way of adding that externally, other than implementing a local git repo and committing every change, and that is quite impractical.
This is also the reason the way Undo/Redo is implemented differently in different software, as not all file formats are maintained equally (flexible) in memory, by the matching software.

If you are rigth and seems to me so then I have to implement the script from pspad and for pspad.

I am trying in pspad forum but my level is not enough to follow the good necessary instructions. So I will have to be patient....

 :-[ :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #10 on: September 07, 2020, 05:58 AM »
Contro might actually be in the market for a full versioning system.
Sorry. Yes. I am versioning.
 ;D

And I need a versioning software or a plugin or a script for pspad. ......
 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #11 on: September 07, 2020, 06:02 AM »
I think I must see the git option.
And thanks Ath because at last your help is very useful.
Best Regards
 :-* :P


Note : I have downloaded the portable version of GIT.
AsusPortatil - 07_09_2020 , 12_51_26.pngControlZ x times

Ejem. have a certain learning curve. ....

 :tellme: :-* :P

I retire to my winter home.....
« Last Edit: September 07, 2020, 06:52 AM by Contro »

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #12 on: September 07, 2020, 05:12 PM »
Filehamster could be an option. It appears to be in development (again). Also requires active input, but iiuc is a lot simpler than full versioning system.
Forget that:
after years of no updates, they fixed a couple of minor bugs end of last year, but no support in 2020, so I would avoid.
Tom

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #13 on: September 07, 2020, 10:44 PM »
Isn't this what File History is for?

In my case I create a network shared folder on the same computer, then use that network location as the backup location (rather than have an external drive plugged in permanently).

Then you can just: Right-click->Properties->Previous Versions

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #14 on: September 08, 2020, 02:08 AM »
If it might help, I could program you a little tool.

Program that I have in my mind:
1. When starting, my tool show all processes, select one to connect to that process.
2. After a process is selected, enter number of loops.
3. click "Go", done.

What would happen is:
1. my program connect to any target you selected
2. my program send "number of loops" times a CONTROL+Z to target.
3. my program closes.


Would that be useful/solve your problem?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #15 on: September 08, 2020, 03:58 AM »
I still do not understand this request:

1) how do I/you know how many Ctrl+z you want to do? If you dont know:

2) why not simply press and hold both Control and z keys until you get back to wherever you want? In most of the software I use this goes incredibly fast.
There are limited number of undo's: in this case Ctrl+z may no longer be of any use => versioning of some sort.
Tom

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #16 on: September 09, 2020, 01:41 PM »
I still do not understand this request:

1) how do I/you know how many Ctrl+z you want to do? If you dont know:

2) why not simply press and hold both Control and z keys until you get back to wherever you want? In most of the software I use this goes incredibly fast.
There are limited number of undo's: in this case Ctrl+z may no longer be of any use => versioning of some sort.
Of course you are right.

As Ath suggest is a question of the program. So I have ask with pspad and they give me an answer : Make a macro to undo.
And with the limit of the number of undone prescribed or allowed....

 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #17 on: September 09, 2020, 01:41 PM »
Isn't this what File History is for?

In my case I create a network shared folder on the same computer, then use that network location as the backup location (rather than have an external drive plugged in permanently).

Then you can just: Right-click->Properties->Previous Versions
I'll take a look. Best Regards.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #18 on: September 09, 2020, 01:45 PM »
If it might help, I could program you a little tool.

Program that I have in my mind:
1. When starting, my tool show all processes, select one to connect to that process.
2. After a process is selected, enter number of loops.
3. click "Go", done.

What would happen is:
1. my program connect to any target you selected
2. my program send "number of loops" times a CONTROL+Z to target.
3. my program closes.


Would that be useful/solve your problem?
At the present moment may be a work to do.

Interesting if you can apply to any program. Or even undo any iterative key combination like control+Z

I think you have the last word now.

Is it interesting for microsoft word ?
For any text editor with control+Z and shift-control-z combinations ?
To go back in any repetitive task ?

 :-* :P

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #19 on: September 09, 2020, 01:55 PM »

with control+Z and shift-control-z combinations

Applications adhering to Windows standards use Ctrl-Z for undo and Ctrl-Y for redo, as that's the most common used key configurations. PSPad is one of very few applications that uses the non-standard Ctrl-Shift-Z for redo.

@KodeZwerg if you start anything for this, please allow configurable hotkeys for sending the undo/redo commands.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #20 on: September 09, 2020, 04:09 PM »
1) how do I/you know how many Ctrl+z you want to do? If you dont know:

2) why not simply press and hold both Control and z keys until you get back to wherever you want? In most of the software I use this goes incredibly fast.
There are limited number of undo's: in this case Ctrl+z may no longer be of any use => versioning of some sort.
[...]
So I have ask with pspad and they give me an answer : Make a macro to undo.
And with the limit of the number of undone prescribed or allowed....
Question #1 and #2 still unanswered....

why not press Ctrl+z and hold until you reach your destination?
How do you know the limit of undo's is your destination?
Tom

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #21 on: September 10, 2020, 12:27 AM »
How do you know the limit of undo's is your destination?
OIW: How do you know the count of Ctrl-Z to be sent? 10x or 25x, or ...?

why not press Ctrl+z and hold until you reach your destination?
That is a far more down to earth approach :Thmbsup:

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #22 on: September 10, 2020, 01:48 AM »
@KodeZwerg if you start anything for this, please allow configurable hotkeys for sending the undo/redo commands.

Do you mean the keys to send should be configurable or that my program has a configurable hotkey?

Interesting if you can apply to any program.
What I would do works for every application, if target support ctrl-z or not, I can not pre-check, my app just send the keys to that application.
(same like you press in that target ctrl-z, either it does or dont, but bad things should not happen)

My guess is: key sender first public release will be delivered on monday.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #23 on: September 10, 2020, 07:52 AM »
1) how do I/you know how many Ctrl+z you want to do? If you dont know:

2) why not simply press and hold both Control and z keys until you get back to wherever you want? In most of the software I use this goes incredibly fast.
There are limited number of undo's: in this case Ctrl+z may no longer be of any use => versioning of some sort.
[...]
So I have ask with pspad and they give me an answer : Make a macro to undo.
And with the limit of the number of undone prescribed or allowed....
Question #1 and #2 still unanswered....

why not press Ctrl+z and hold until you reach your destination?
How do you know the limit of undo's is your destination?
Mmmmm. I am surprised.

I will try this of course. I usually repeat the combination, but not hold.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: ControlZ x times
« Reply #24 on: September 10, 2020, 07:57 AM »
@KodeZwerg if you start anything for this, please allow configurable hotkeys for sending the undo/redo commands.

Do you mean the keys to send should be configurable or that my program has a configurable hotkey?

Interesting if you can apply to any program.
What I would do works for every application, if target support ctrl-z or not, I can not pre-check, my app just send the keys to that application.
(same like you press in that target ctrl-z, either it does or dont, but bad things should not happen)

My guess is: key sender first public release will be delivered on monday.

:-* :P

Honestly I think you have the very best advisers for this program.

thanks Ath, thank tomos.

Thanks everyone . I will give my opinion as a final user.

While reading i was thinking about a do-redo app, but key sender is much better.
But key sender must be able to be configurable according to ath and its name. Not only for control+z combination.

 :tellme: