Jump to content

sconley

Active Members
  • Posts

    77
  • Joined

  • Last visited

About sconley

  • Birthday 03/27/1960

Profile Information

  • Location
    Elkton, Virginia, USA
  • Interests
    Computers (naturally), hiking, sci-fi

sconley's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. When I try to run a compiled AutoIT 3 script while in a Virtual PC (VPC) guest, when the compiled script is on a VPC shared folder from the host, I get the error "Unable to open the script file". The same script, uncompiled works OK. I cannot compile a script on a VPC shared folder: I get the Aut2exe error "unable to execute upx.exe to compress stub file". I realize this may be a Microsoft Virtual PC error; however, AutoIt 3 is the only program I'm having problems with so far.
  2. Is it possible to have more than one PC using IniRead() and IniWrite() to the same file on a network share without getting errors?
  3. Thanks for the information... Is there a list of what directives CompileAU3.exe uses?
  4. I may have missed it in my searching, but I can't find a list of the compiler directives (#<directive>) other than what is listed in the Keywords/Statement Reference of the help file). I know there are others (#region, #endregion, etc.) Where are they?
  5. I couldn't figure out how to create the backup directory in LUA in a direct manner, but I do believe I have it working...it does show a flash of a black DOS window if it has to create the directory. The backup probably should default to the source directory. I was having so so so many backups in my source directory that it became unmanageable. I put code in to have it default to the source filename's directory. I made a couple of changes (I left the my_ prefix in front of what I added): -- function OnBeforeSave(filename) local sbck = tonumber(props['backup.files']) -- no backup specified if sbck == nil or sbck == 0 then return false end -- Find the last backslash in filename in order to format a path to the backup folder local my_loc_of_last_backslash = (string.find(filename,"[^%\\]*$",1)) if my_loc_of_last_backslash == nil then return false end my_loc_of_last_backslash = my_loc_of_last_backslash - 1 -- Extract the last part of the filename local my_filename = string.sub(filename,my_loc_of_last_backslash + 1,-1) -- Extract the drive letter local my_drive_letter = string.sub(filename,1,2) -- Extract filename's path local my_path = string.sub(filename,1,my_loc_of_last_backslash - 1) -- Retrieve path to backup folder from properties file. Default to filename's path. local my_backup_path = (props['backup.path']) if (my_backup_path == nil) or (my_backup_path == 0) then my_backup_path = my_path end -- Format complete path to location where backups will be stored. Create path if it does not exist my_backup_path = my_drive_letter .. string.sub(my_backup_path,3,-1) if (os.rename(my_backup_path,my_backup_path)) == nil then os.execute('mkdir "' .. my_backup_path .. '"') end -- Shift existing backups up by 1 local my_tmp_filename1 = '' local my_tmp_filename2 = '' local my_index = sbck while (my_index >= 1) do my_tmp_filename1 = my_backup_path .. "\\" .. my_filename .. "." .. my_index .. ".bak" os.remove(my_tmp_filename1) if my_index ~= 1 then my_tmp_filename2 = my_backup_path .. "\\" .. my_filename .. "." .. (my_index - 1) .. ".bak" os.rename(my_tmp_filename2, my_tmp_filename1) end my_index = my_index - 1 end -- Rename the original file to .1.bak my_tmp_filename2 = my_backup_path .. "\\" .. my_filename .. ".1.bak" os.rename(filename, my_tmp_filename1) return false end
  6. After looking at your code, I became a little interested in Lua. I modified the code to create the backups in a different folder on the same drive as the original source and I used ".1.bak" for the first backup instead of ".bak". There was nothing wrong with your code...I just started playing with Lua to see what I could do. -- function OnBeforeSave(filename) local sbck = tonumber(props['backup.files']) -- no backup specified if sbck == nil or sbck == 0 then return false end local my_backup_path = (props['backup.path']) if (my_backup_path == nil) or (my_backup_path == 0) then my_backup_path = "d:\\Sci-TE-Backup" end -- Determine where to store the backups local my_loc_of_last_backslash = (string.find(filename,"[^%\\]*$",1)) if my_loc_of_last_backslash == nil then return false end my_loc_of_last_backslash = my_loc_of_last_backslash - 1 -- Extract the last part of the filename local my_filename = string.sub(filename,my_loc_of_last_backslash + 1,-1) -- Extract the drive letter my_drive_letter = string.sub(filename,1,2) -- Format complete path to location where backups will be stored my_backup_path = my_drive_letter .. string.sub(my_backup_path,3,-1) -- Shift existing backups up by 1 local my_tmp_filename1 = '' local my_tmp_filename2 = '' local my_index = sbck while (my_index >= 1) do my_tmp_filename1 = my_backup_path .. "\\" .. my_filename .. "." .. my_index .. ".bak" os.remove(my_tmp_filename1) if my_index ~= 1 then my_tmp_filename2 = my_backup_path .. "\\" .. my_filename .. "." .. (my_index - 1) .. ".bak" os.rename(my_tmp_filename2, my_tmp_filename1) end my_index = my_index - 1 end -- Rename the original file to .1.bak my_tmp_filename2 = my_backup_path .. "\\" .. my_filename .. ".1.bak" os.rename(filename, my_tmp_filename1) return false end
  7. I'm just starting to use the GUI features in AutoIt3, so this question may have an obvious answer that I don't see. I've created a GUI Window using the $WS_VSCROLL style Bitor'd with $GUI_SS_DEFAULT_GUI. I get a vertical scroll bar, but it won't scroll. I have controls that are below the bottom border of the GUI that I can't get to. What am I missing?
  8. SciTE changes the indentation of the CASE statement after a SELECT statement to be the same level as the SELECT. While typing, the CASE statement is initially indented correctly; however, when you press ENTER, the indentation is changed back to the same level as the SELECT. Example: Looks like: The EndSelect also wants to indent at the same level as the last CASE statement. NOTE: the Tidy program fixes everything back the way it should be.
  9. Thanks... The code worked fine...
  10. Is there a way have SciTE to save the previous version of a file when it saves the new file? The other script editors I have used save at least 1 and usually several previous versions of files.
  11. I don't see any documentation on this feature. I'm assuming that I can use the "text" on a button instead of the classname##.
  12. Nevermind... I found my problem... How is ControlGetFocus supposed to work? $CurrentControl = ControlGetFocus($WinTitle,$WinText) I have an AU3GUI window running. No matter what control I have the cursor on, I get a 1 from ControlGetFocus. For testing purposes, I'm running a loop with a 1 second pause that runs ControlGetFocus and puts the answer into the AU3GUI form using the controlsettext function.
  13. To move a folder, use the FileMove function. Example: If not FileMove("c:\topfolder\folder1","c:\anotherfolder\folder1") msgbox(0,"Error","FileMove failed!") exit(1) endIf As with the Windows Move command, the source and destination must be on the same drive for this to work (at least my test showed it wouldn't work between drives.) To copy a folder you could run xcopy as follows (watch for line wrap in code below): runwait(@comspec & " /c xcopy /s/e/i c:\topfolder\folder1 c:\anotherfolder\folder1") If you have spaces in your paths you must enclose in quotes which looks confusing. Here is an example using variables: runwait(@comspec & ' /c xcopy /s/e/i "' & $Src_Folder & '" "' & $Dest_Folder & '"')
  14. Your correct...I changed my code to use {F11} and the hotkey is not working. thanks....
  15. Can I use HotKeySet to set {F12} as a hot key? I have only been able to get this to work if I use Alt or Ctrl in combination with another key. I thought I read another post concerning this but could not find it.
×
×
  • Create New...