Title

Message

Confirm

<< DiscussionsReply

Help with Macro Error Correction & Enhancement

UWK-87
164 discussion posts
Hi Guys,
Was creating a small macro, that does the following:
  • Copy Selected Text
  • Opens Notepad.exe
  • Paste the selected text
The issue is if I do the following code, sometime CF pastes before even notepad window gets focus:

Code


I resolved that issue by using ThreadWait in between application start and paste, however, I believe that is not a proper method so I wanted to use the WindowFocus and that is where I get the error. Below is the code and the error:

Code


ERROR:

Code


Can someone kindly help with the above code. Also is there is another Macro that Thomas created "Get Filenames from Clipboard". Is it possible to achieve the following:
  • Check Selected Data, If text proceed to next step. If files then get result from "Get Filenames from Clipbpard Macro"
  • Open Notepad
  • Make sure the focus command makes it active (Is it possible to handle a case where multiple notepad files are open then focus on the newly created process?)
  • Paste either the Filenames or Text
Thanks is advance guys.
Jan 30, 2018 (modified Jan 31, 2018)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Let's solve the first problem first (verifying that the Notepad window has focus). Can you give this code a try?

Code

Jan 31, 2018  • #2
UWK-87
164 discussion posts
Hi Keith,
Thank you so much for helping out. Worked like a charm for the 1st issue.
Thanks,
Usama Waheed
Jan 31, 2018  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, try this out for the second thing

Code

Jan 31, 2018  • #4
UWK-87
164 discussion posts
Thanks Keith worked like a charm
Thank you so much for helping out!
Jan 31, 2018  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
No worries, glad to hear it!
Jan 31, 2018  • #6
Was this helpful?    
<< DiscussionsReply