BatMan22 Posted March 11, 2022 Share Posted March 11, 2022 Can you change backup locations? I love that autoit backs up automatically, super cool feature as I have terrible saving/version/iteration habits. But is there any way to drop it to a folder instead of directly into script location? Basically I want to drop it to ..\backup instead of .. Link to comment Share on other sites More sharing options...
BatMan22 Posted March 11, 2022 Author Share Posted March 11, 2022 -------------------------------------------------------------------------------- -- OnBeforeSave(filename) -- -- keep the number of backups as defined by backup.files = ? by Jos van der Zande (JdeB) -- -- AutoItTools.OnBeforeSave $(au3) 2 Alt+Shift+I Open Beta Include -------------------------------------------------------------------------------- function AutoItTools:OnBeforeSave(filename) local sbck = tonumber(props['backup.files']) -- backup specified and bigger than 0 ? if sbck == nil or sbck == 0 then return false end local nbck = 1 local bfil1 = "" if sbck > 1 then bfil1 = ".1" end -- check first file backup file format without number and rename it to *.1.bak if sbck > 1 and io.open (filename.. "." .. ".bak", "r") == nil and io.open (filename.. "." .. ".1.bak", "r") == nil then os.rename (filename .. ".bak", filename .. ".1.bak") end -- rename all files to +1 while (sbck > nbck ) do local fn1 = sbck-nbck local fn2 = sbck-nbck+1 os.remove (filename.. "." .. fn2 .. ".bak") os.rename (filename .. "." .. fn1 .. ".bak", filename .. "." .. fn2 .. ".bak") nbck = nbck + 1 end -- rename original to .1.bak or .bak depending on number of backups os.remove (filename.. bfil1 .. ".bak") os.rename (filename, filename .. bfil1 .. ".bak") return false end I think I have to edit the AutoItTools.lua but I don't have any clue what to do.. I don't know how to program in .lua Link to comment Share on other sites More sharing options...
Nine Posted March 11, 2022 Share Posted March 11, 2022 BatMan22 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
BatMan22 Posted March 11, 2022 Author Share Posted March 11, 2022 @Nine Sweet thanks! I saw that thread but he was talking about command prompts so I got scared off but it seems to work great. For future googler's, see below. Edited my 'C:\Program Files (x86)\AutoIt3\SciTE\lua\AutoItTools.lua' file to add the "perform_oscommand" function and modified the "AutoItTools:OnBeforeSave(filename)" function as listed in the comment below and it worked. https://www.autoitscript.com/forum/topic/203221-scite-backup-copies/?do=findComment&comment=1461812 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now