Jump to content
Macro Express Forums

Macro To Run The "Undo Command" In File Explorer


Recommended Posts

Hello, I'll try to keep this simple. I want to run the "Undo Delete" command that's in File Explorer while I have a program running. Is there a way to do that?

 

Currently the macro that I have is:

1) to minimize everything

2) move the mouse to the top-left pixel of the screen

3) right-click & text type: u    [to Undo Delete]

4) then restore the program I have that was working in

 

Is there a way to keep the program running on the screen & have Macro Express run the "Undo Delete" command without anything changing visually on-screen? Thanks

Link to comment
Share on other sites

No. Macro Express does not have a built-in undelete file command and in order for File Explorer to perform the undelete it must have focus. The only thing I would consider changing is instead of 1) minimize everything I would use the Window Activate command to give File Explorer focus but leave all the other windows alone.

Link to comment
Share on other sites

Thanks for the reply.

Yea I tried thinking of other alternate solutions to this, and I did think of your idea. The thing about Focusing File Explorer is rather messy too, because I would have to open File Explorer and wait for it to load (which isn't that long, but you know how when you open it, it fades in), and after that I actually tried sending the File Explorer window to the bottom-right section of the screen (to hide the File Explorer window from showing up on screen). The only thing is that once I open File Explorer, it shows up in the middle of the screen for a split milli-second, then gets thrown off to the bottom right corner. Also another bug I encountered after having the window sent to that corner is that, sometimes the Undo Delete worked and sometimes it didn't. So that method is also a bit "messy" for the visual on screen. 

I asked on the TenForums site to see if anyone knows how to create a shortcut [while in File Explorer, Right Click > New > Shortcut] for a command that can execute the "Undo" function. So something along the lines of:

"C:\Windows\explorer.exe" [and an argument to run the Undo function in Explorer]

Yet I haven't gotten a solution for that. You see, if I can figure out a shortcut that I can make that does this, that would be so much more convenient, since I can set up a macro to execute that file easily! Does anyone here know how to do that?

Anyways, thanks for your help!

Link to comment
Share on other sites

The application is a Picture Viewer. I download a collection of wallpaper images. I go through the pictures and press the Delete button to the pictures that I don't want to keep. The Delete button deletes a picture, yet there is no Undo Delete function within the application. So suppose I delete a picture accidentally, and I want to recover that picture, I cannot press CTRL+Z in the application, because that is not supported in there.

Yet I have a Macro Express macro that when I press Backspace (specifically in that application), it will minimize everything, it will send the mouse to the top left corner of the Desktop, it will Right-Click the mouse, Text Type U [for undo], and then restore the picture viewer application. I want to avoid all that from happening, and only to undo the delete while the application is open on the screen (not minimized).

I hope this post makes what I'm trying to say, clearer.

Link to comment
Share on other sites

I have noticed if you do a copy or move, then right clicking gives you the option to undo that copy or move -- it does not revert to the the last delete.  If you undo a delete then right click, you get the option to re-do the delete (or copy, or move).  So it is context-sensitive to your last action, and could quickly degenerate into who-knows-what if you are not watching closely. 

Perfect is the enemy of good.

At this point you are good.  Be satisfied. :)  

Link to comment
Share on other sites

Whenever I'm going through the pictures and deleting the ones I don't want, Right clicking on the Desktop, for example, will always have the Undo Delete option, because there is nothing else that's running in the background that could interfere with this process.

I am only asking for a method that could run the Undo command through Macro Express without going through the process of the set up that I posted earlier. Or in other words, how can I do Ctrl+Z without having File Explorer focused?

Link to comment
Share on other sites

When you press something like Ctrl+z it goes to the window that has focus. If Macro Express types Ctrl+z then it too goes to the window that has focus. In order to have a macro undo the delete you need to the macro set focus to File Explorer.

Does the Windows Recycle Bin do what you need? If you accidentally delete something you can use the Recycle bin to recover it.

Link to comment
Share on other sites

So a random idea popped in my head! I said, what if I set focus to some "hidden" window that's part of the operating system, Control + Z, refocus my image program, press the left key to go to previous image (the one that I just recovered)?

That idea seems to be working! (If it stops working, which it shouldn't, then I'll post back on that). But I will post a screen shot of that macro. The bottom part was my original method stated earlier. (I'm holding on to it for now just in case)

 

Current Solution.png

Link to comment
Share on other sites

Hi, thanks! And you're welcome.   =)

Yes, this works without having Program Manager flash on the screen at all, which is exactly what I was hoping for! It is some Operating System window that is 'hidden'. So when I run the macro, all I see on the screen is the Image Viewer program (JPEGView) become inactive [the top bar of the program becomes gray], then less than a second later, JPEGView becomes the active window again, and the Left Arrow key is pressed to go to the previous image (which is the image that was just recovered when the Ctrl+Z command was run). 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...