Tosyk Posted August 5, 2023 Share Posted August 5, 2023 I'm using $CmdLine currently. But it has windows limitations. So while not found the answer, I'm asking if there's a way to do it without $CmdLine and Autoit? Maybe with some workaround? I really need to update my knowledge on that term to then update my scripts where I use drag and drop a lot if not always. Thank you. Link to comment Share on other sites More sharing options...
Andreik Posted August 6, 2023 Share Posted August 6, 2023 Drag and drop is possible but you should be more specific. A compiled script can be a console application or it might have a GUI where you drop files. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Tosyk Posted August 6, 2023 Author Share Posted August 6, 2023 8 hours ago, Andreik said: Drag and drop is possible but you should be more specific. A compiled script can be a console application or it might have a GUI where you drop files. Thank you for the reply. I use GUI only to show the progress of processing with a progress bar but that's not the point atm. What I do is I select numerous of files and drop on a compiled script .exe. Link to comment Share on other sites More sharing options...
argumentum Posted August 6, 2023 Share Posted August 6, 2023 We put the code where our mouth is. Is just easier to understand. Using explorer you select a bunch of files and drop them on script.exe. Look at $CmdLine in the help file. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
argumentum Posted August 6, 2023 Share Posted August 6, 2023 14 hours ago, Tosyk said: without $CmdLine $CmdLineRaw Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Tosyk Posted August 6, 2023 Author Share Posted August 6, 2023 22 minutes ago, argumentum said: $CmdLineRaw I tried it. It works the same way - can't handle many files at once. Saying it's too long. Link to comment Share on other sites More sharing options...
argumentum Posted August 6, 2023 Share Posted August 6, 2023 ..you can only pass up to 2000 characters on command line but is a window limitation. You will process 15 files max from drag and drop and again is a windows limitation. Maybe you can use a different approach to solve your issue ?, think of alternate ways to go about it. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Tosyk Posted August 6, 2023 Author Share Posted August 6, 2023 10 minutes ago, argumentum said: ..you can only pass up to 2000 characters on command line but is a window limitation. You will process 15 files max from drag and drop and again is a windows limitation. Maybe you can use a different approach to solve your issue ?, think of alternate ways to go about it. I know the basic functions of autoit pretty well, and I have a lot of tools I made and use daily to convert a bunch of files from one state to another. But this limitation has always been making me crazy. I'm on vacation rn and thought I could update my tools. That's why I'm here. I know about limitation of windows, I mentioned it in the first post. I simply want to select 10K of files, drop them on the script.exe, see the progression of converting and get converted files. Link to comment Share on other sites More sharing options...
jchd Posted August 6, 2023 Share Posted August 6, 2023 I don't have a folder with 10K files in it, but this works with 400 files, providing an array with each file in its own cell. Of course, you have to first select many files using Explorer, then run this code (even uncompiled) and handle the drop at your own pace. _ClipBoard_Open(0) Local $data = _ClipBoard_GetData($CF_HDROP) Local $bin = BinaryMid($data, 21, BinaryLen($data) - 24) Local $c, $s For $i = 1 To BinaryLen($bin) Step 2 $c = BinaryMid($bin, $i, 2) $s &= ($c <> 0 ? ChrW($c) : "|") Next $aFiles = StringSplit($s, "|", 3) _ArrayDisplay($aFiles) ; Close the clipboard _ClipBoard_Close() argumentum, pixelsearch, Tosyk and 1 other 4 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
argumentum Posted August 6, 2023 Share Posted August 6, 2023 45 minutes ago, jchd said: I don't have a folder with 10K I have a ram drive I made 10 thousand files, select them all ( Ctrl-A ), then copy ( Ctrl-C ), and after a sec or two, the array displayed all 10000 files Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pixelsearch Posted August 6, 2023 Share Posted August 6, 2023 (edited) @jchd that's great (never used $CF_HDROP before). What about this, quickly done, no error checking : error should be checked, or we could use a simple ClipGet() in this case #include <Array.au3> #include <Clipboard.au3> #include <WinAPISysWin.au3> _ClipBoard_Open(0) Local $aSelected = _WinAPI_DragQueryFileEx(_ClipBoard_GetDataEx($CF_HDROP)) _ArrayDisplay($aSelected) _ClipBoard_Close() Just tested on thousand of files in Windows, System32, after selecting and copying all of them to clipboard (Ctrl+a, Ctrl+c) Edit: I tried this after reading what follows on msdn : CF_HDROP (15) A handle to type HDROP that identifies a list of files. An application can retrieve information about the files by passing the handle to the DragQueryFile function. Edited August 6, 2023 by pixelsearch ioa747 1 Link to comment Share on other sites More sharing options...
Tosyk Posted August 6, 2023 Author Share Posted August 6, 2023 @jchd and @pixelsearch, Thank you, guys. However, can this approach be converted into a drag and drop function? Link to comment Share on other sites More sharing options...
jchd Posted August 6, 2023 Share Posted August 6, 2023 @pixelsearch I tried this way since we were told that about 15 files would be the Windows limit. Didn't look further. @Tosyk why can't you convert smaller batches of files, rather than trying to convert 10K at once? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
argumentum Posted August 6, 2023 Share Posted August 6, 2023 here's an example. He is not very clear on what how. In so far it looks like drop on the exe itself and not a GUI. He's on vacation. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pixelsearch Posted August 6, 2023 Share Posted August 6, 2023 (edited) @argumentum not sure YGYL0's script (the link you provided) would work if drag & drop was done on an exe file icon, without an opened GUI, when plenty of files are involved. What I see in his script is that he bypass the Windows limitation (which is not 15, it depends on the length of the path). By the way, without his script, I just could drag & drop 40 files on an exe because their path was short (like C:\Temp3\filenames). When paths are longer, then the number of files you can drag & drop on an exe is reduced, probably because of the 2000 characters limit you indicated.@Tosyk if there is no way to achieve your goal and as it seems important to you, then I suggest you just create a small GUI in your script, with a droppable zone, then you'll be able to drop thousands of file names in one pass, like in a script I wrote several years ago : Before selecting a bunch of files from Windows Explorer (or XYplorer I use in its place), I just double click the icon of the script (the icon IS placed on the desktop for an easy & immediate access), select no matter how many files, drag & drop them on the droppable blue zone in the GUI, it never failed (the droppable zone is blue and active only when the radio button "Drag them here" is checked) Edited August 6, 2023 by pixelsearch Link to comment Share on other sites More sharing options...
argumentum Posted August 6, 2023 Share Posted August 6, 2023 YGYL0's script DnD on a GUI. If you're gonna drop on an executable, ...that's a pickle. Why the need to DnD 10,000 files on an exe ?... no clue. But I like the topic, so I got involved Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
ioa747 Posted August 7, 2023 Share Posted August 7, 2023 3 hours ago, pixelsearch said: like in a script I wrote several years ago I found this version (without drag and drop)https://www.autoitscript.com/forum/topic/199830-resizing-images-script Where can I find the version you describe above? Thanks I know that I know nothing Link to comment Share on other sites More sharing options...
pixelsearch Posted August 7, 2023 Share Posted August 7, 2023 (edited) @ioa747 please never think I don't want to share it but the last versions and their hotkeys are very much linked to the software I use (XYplorer, ACDsee, Opera, FF etc...) plus they all require a special reworked version of "ArrayDisplayInternals.au3" with functions named for example Func _ArrayDisplay_Is_Calling(), tweaks etc... which makes the script impossible to run outside of my computer, without downgrading it. When I have time, I'll try to check if an older release (including drag & drop) could be more suitable to AutoIt users, but it will take time because of all the releases done these last years : Edited August 7, 2023 by pixelsearch ioa747 1 Link to comment Share on other sites More sharing options...
jchd Posted August 7, 2023 Share Posted August 7, 2023 I'd recommend Faststone Resizer free for home use and w/o nasties. Lots of options there and very fast. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Tosyk Posted August 7, 2023 Author Share Posted August 7, 2023 (edited) 14 hours ago, jchd said: why can't you convert smaller batches of files, rather than trying to convert 10K at once? Because I'm doing it right now, and this is not really convenient 13 hours ago, argumentum said: Why the need to DnD 10,000 files on an exe ? I'm working with a huge amount of data and assets on my job, so it's almost a day-to-day task 13 hours ago, pixelsearch said: if there is no way to achieve your goal and as it seems important to you isn't it really? I still hope there's a way : ) 13 hours ago, pixelsearch said: then I suggest you just create a small GUI in your script Thank you, I have thought about this. Unfortunately, it makes my workflow more complicated and by using autoit I was hoping to improve my work. Actually, the main intention of the tool is to automate the processes. I have a bunch of files: I select some of them -> right click -> Send to -> choose the my autoit script.exe -> GUI appears -> I select options and click OK. Edited August 7, 2023 by Tosyk 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