Regarding AHK and file management (moving/renaming/writing)…

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sashaatx
Posts: 333
Joined: 27 May 2021, 08:27
Contact:

Regarding AHK and file management (moving/renaming/writing)…

Post by sashaatx » 30 Jun 2022, 15:43

If you feel AHK is great for this, what can I do to make it most efficient

!if, where are the areas I should avoid ahk for?

When I have posted in the past about:

Fileread() fiilewrite() abaout plain txt files, its an easy function and works. (if I dont use the right names, I dont have sintax in front of me)

but if I ask about:

moving directories

copying files, or directory trees

find and replace functions

I received most responses telling me to use r/PowerShell

Its an open question on purpose to a degree, I dont know if theres a reason I was recommended this but it wouild appear there are areas of file admin that AHK just doesnt do as well as windows/python.

I know the ahk language better than others like powershell, there for it limits my abilities, and at the same time I instinctually avoid ahk for file stuff because of the advice I received.

Any insight is appreciated. If you have a why, or if I should look twice at capabilities in this area becauase maybe the advice I was given was wrong
Last edited by BoBo on 01 Jul 2022, 02:54, edited 1 time in total.
Reason: Changed the novel'ish subject line: "Question: I hear a lot of feedback regarding AHK and file management (moving/renaming/writing), it seems some things ahk"


User avatar
Smile_
Posts: 858
Joined: 03 May 2020, 00:51

Re: Question: I hear a lot of feedback regarding AHK and file management (moving/renaming/writing), it seems some things

Post by Smile_ » 30 Jun 2022, 17:01

Here is some suggestions:
Read here for full documentation

FileMove to move and/or rename files.
FileMoveDir to move and/or rename directories.
FileCopy to copy files.
FileCopyDir to copy directories.
FileRead to read from a file.
FileAppend to append text to a file.
FileObject offers several useful methods for reading & writing files.
InStr for searching strings.
StrReplace for sub-strings replacements.

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Question: I hear a lot of feedback regarding AHK and file management (moving/renaming/writing), it seems some things

Post by lexikos » 30 Jun 2022, 21:42

If you ask in a community that favours PowerShell, of course that will be the answer. If you were given some specific advice about drawbacks of using AutoHotkey for file management, let's hear it. It is impossible to know whether the advice you were given is accurate without hearing what that advice was.

User avatar
Chunjee
Posts: 1419
Joined: 18 Apr 2014, 19:05
Contact:

Re: Question: I hear a lot of feedback regarding AHK and file management (moving/renaming/writing), it seems some things

Post by Chunjee » 01 Jul 2022, 01:50

sashaatx wrote:
30 Jun 2022, 15:43
!if, where are the areas I should avoid ahk for?
Main issue I had with filemove on a lot of individual files is it is very slow at a one-by-one move. Move the whole folder if possible.

Another issue I had was moving files over the network or internet; some would fail and filemove doesn't have a built in retry, you can code one though.

I had a lot more success when I started using Robocopy via ahk run command.

Code: Select all

RunWait, %comspec% /c Robocopy "%Path_Source%" "%Path_Destination%"

Post Reply

Return to “Ask for Help (v1)”