AndyS01 Posted March 5, 2009 Share Posted March 5, 2009 I'm trying to write a "SendTo" script that does a 'find' on all selected files and folders and writes the found names to a file. Because I ran into "arg list too long", I decided to try an AutoIt script that calls an 'open' dialog box (FileOpenDialog). However, this dialog only returns the file names not the folder names (hence the name FILEopendialog ). I need to somehow hook into the XP Windows Explorer's dll to see which file and folder names have been selected and process them. If anyone can point me to code that does something like this, I would appreciate it. Andy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 5, 2009 Moderators Share Posted March 5, 2009 (edited) AndyS01,I cannot help with the Explorer hook, but I can suggest some Autoit functions that might help you achieve what you want to do:FileOpenDialog (which you already know) selects filesFileSelectFolder selects folders (as you might have guessed!)Put these into an array/string as you go along and you have your list to write using FileWrite.If the files share a common pattern (same name or extension) then FileListToArray might prove useful as it does what it says - within limits as it is not recursive. If you need a recursive version, I have one which I could post.I hope this helps - or at least gives some food for thought.M23Edit: Welcome to the forums, by the way! Edited March 6, 2009 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AndyS01 Posted March 6, 2009 Author Share Posted March 6, 2009 Almost, but not quite. What the script I'm writing does is to create a text file containing all of the files, folders and sub-folders based on the selected files and folders. The selection is done in an Explorer window, then the window is right clicked to bring up the context and SendTo menu, where the call to my script is. Because I don't know how to hook into the explorer dll, I'm trying to write an AutoIt script to do the same thing. Link to comment Share on other sites More sharing options...
martin Posted March 6, 2009 Share Posted March 6, 2009 Almost, but not quite. What the script I'm writing does is to create a text file containing all of the files, folders and sub-folders based on the selected files and folders. The selection is done in an Explorer window, then the window is right clicked to bring up the context and SendTo menu, where the call to my script is.Because I don't know how to hook into the explorer dll, I'm trying to write an AutoIt script to do the same thing.I think ProgAndy has solved this for you here. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Anteaus Posted March 6, 2009 Share Posted March 6, 2009 Alternatively, a crude (but effective) way to do this is to call on the DIR /B function of the command processor: $runstr=@comspec & " /c dir c:\mymusic\*.mp3 /b /s >dirlist.txt run($runstr) will generate a file listing. You can then read dirlist.txt into a script and filter as required. The more sophisticated way is to use the FileFindFirstFile.. FileFindNextFile.. functions, but this involves a lot more effort. Link to comment Share on other sites More sharing options...
CodyBarrett Posted March 7, 2009 Share Posted March 7, 2009 command prompt MIGHT be more usefull, because it lists them automaticaly and autoit uses a loop.... whatever you want if you want less lines (only like 5 or so) use the CMD and if you want loop use filefindfirstfile() [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
GEOSoft Posted March 7, 2009 Share Posted March 7, 2009 Alternatively, a crude (but effective) way to do this is to call on the DIR /B function of the command processor: $runstr=@comspec & " /c dir c:\mymusic\*.mp3 /b /s >dirlist.txtrun($runstr)will generate a file listing. You can then read dirlist.txt into a script and filter as required. The more sophisticated way is to use the FileFindFirstFile.. FileFindNextFile.. functions, but this involves a lot more effort.You don't need to send it to a file. Just send it to the stdout stream. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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