Recently Browsing 0 members
No registered users viewing this page.
Hi guys! i want to write speedy and very fast code to check if chosen filename exists then add "-1" at end of it and if chosen filename exists again, add "-2" instead of "-1" and check filename until be unique.
For Example: I have to write "Filename.txt" in C:\ directory with FileOpen then check if "Filename.txt" exists in that directory then rename chosen filename to "Filename-2.txt" and if exists again in directory, rename chosen filename to "Filename-3.txt" and do this work until to find unique number to add end of filename.
====================== SOLUTION by @Subz ======================
I'm trying to build a script that will eventually create a log with time stamps of the active windows used on a workstation throughout the day, but I'm having a problem figuring out how to actually get this information. For example, if someone has Microsoft Word open, I'd like to be able to pop-up/log "word.exe" along with the full path to that file if at all possible (sort of like seeing the application DETAILS name in Windows Task Manager and being able to right-click on the name and choose "Open FIle Location" to get the full path to the file).
Is what I'm asking even possible within the realm of AutoIt? I have the below script as a test that gets me the current active window handle and title in a message box every 6 seconds, but for the life of me, I don't know what code I need to use to get the actual .EXE name/path of the active window.
#include <MsgBoxConstants.au3> Local $i = 0 Do Global $handle = WinGetHandle("[ACTIVE]") Global $title = WinGetTitle("[ACTIVE]") MsgBox(0,"Active Handle & Title",$handle & " - " & $title, 3) $i = $i + 1 Sleep(3000) Until $i = 100 Any help or suggestions would be greatly appreciated. I don't mind figuring out the code myself, if someone could just point me in the right direction.
I have a problem with FileOpenDialog using long default filenames ... they always get truncated.
"A Long FileName.mpg" as a default would prompt as just "FileName.mpg" (but scrolling left will show it named correctly).
Does anyone know of a fix for this please (I didn't spot it in a Forum search), or is it one for the bug tracker?
#include <FileConstants.au3> #include <MsgBoxConstants.au3> Local Const $sMessage = "Hold down Ctrl or Shift to choose multiple files." Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", BitOR($FD_FILEMUSTEXIST, $FD_MULTISELECT), "A Long FileName.mpg") Thanks,
Just a simple little (complex enough) program I whipped up, for a purpose ... but only too happy to share.
It can of course be modified to do more, but at the moment just compares file names with or without path ... Location versus Checklist.
There are of course other compare programs out there, most doing a lot more than mine (i.e. WinMerge or FileComparer). But I wanted something quick and simple with drag & drop, that uses up a smallish amount of screen real estate.
NOTE - The SAVE button is also a LOAD one, and displays 'Load' when the list is empty. So you can save and load specific lists. While in SAVE mode, the button can also be used with CTRL held down, to ADD another list to existing (displayed one) ... combining as they say ... though not saved until you SAVE. CLEAR button removes a selected entry, or if used with CTRL held down, queries about removing all listed entries.
Files Checklist v1.2.zip
Files Checklist v1.3.zip
Files Checklist v1.4.zip (Includes a BUGFIX.)
WARNING - While this program does not act on files or folders ADDED or CHECKED, you might act on the results, so I advise caution, and I also recommend using the new 'Relative' option in v1.3 or newer ... but you still need to understand what you are doing and what the results actually mean. Some basic examples in the next post.
Users might also be interested in another somewhat related program of mine.
I have an inquiry from you
I have a file path with commands line
Is there a way to separate the path from the commands line?
I want the result in an array
$path = '"c:\NVDA\NVDA slav Portable 1\NVDA.exe" -r -m -path="d:\NVDA Path\Portable"'
there are any method to separate this text?
i want the result to be as that
$array = "c:\NVDA\NVDA slav Portable 1\NVDA.exe"
$array = '-r -m -path="d:\NVDA Path\Portable"'
Thanks in advance
am Waiting for your answers