Ahk Scrpit that copy text from notepad and rename files Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mickey12
Posts: 38
Joined: 28 Apr 2022, 19:36

Re: Ahk Scrpit that copy text from notepad and rename files

Post by mickey12 » 16 May 2022, 17:13

I just tried this i removed number from notepad but i am still getting the Output in fn but without number now so i think that solves this.

User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: Ahk Scrpit that copy text from notepad and rename files  Topic is solved

Post by mikeyww » 16 May 2022, 17:23

Code: Select all

If !A_IsAdmin && !(DllCall("GetCommandLine", "str") ~= " /restart(?!\S)") {
 Try Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
 ExitApp
}
dir = c:\Users\New folder\New folder
ext = png
ControlGetText, list, Edit1, ahk_exe notepad.exe
notepad := StrSplit(list, "`r`n")
Loop, Files, %dir%\*.%ext%
 If (notepad[A_Index] > "")
  FileMove, %A_LoopFilePath%, % dir "\" notepad[A_Index] "." ext
MsgBox, 64, Done, Done!

mickey12
Posts: 38
Joined: 28 Apr 2022, 19:36

Re: Ahk Scrpit that copy text from notepad and rename files

Post by mickey12 » 16 May 2022, 17:54

Thank you so much it works
I have one more question is it necessary to run this script as admin

User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: Ahk Scrpit that copy text from notepad and rename files

Post by mikeyww » 16 May 2022, 18:07

Your particular folder is protected by Windows. Otherwise, no.

Post Reply

Return to “Ask for Help (v1)”