pcjunki Posted November 10, 2014 Share Posted November 10, 2014 I need help with an array, (I'm hoping this is the way to go if not please point me in the right direction) I'm trying to make a script that will create pdfs from a random name word file. I have a vbs script that creates the pdf, and it's command line driven so I'm good on that part at any given time, there will only be 1 word file in c:folder this is what I have so far #include <File.au3> #include <Array.au3> $file = _FileListToArray ( "c:\folder" , "*.doc" ) $file2 = _ArrayDisplay ($file, "" , "1:1") ShellExecute("c:\folder\doc2pdf.vbs" , $file ) ;~ Sleep(4000) ;~ FileDelete $file ;~ ShellExecute("notepad" , "\\webserver\main_site\pages\index.htm") Link to comment Share on other sites More sharing options...
Luigi Posted November 10, 2014 Share Posted November 10, 2014 Something like this??? #include <File.au3> #include <Array.au3> Local $aDoc = _FileListToArray("c:\folder", "*.doc") For $ii = 1 To $aDoc[0] ShellExecuteWait("c:\folder\doc2pdf.vbs" , $aDoc[$ii]) Next pcjunki 1 Visit my repository Link to comment Share on other sites More sharing options...
pcjunki Posted November 10, 2014 Author Share Posted November 10, 2014 perfect! thanks Link to comment Share on other sites More sharing options...
Luigi Posted November 10, 2014 Share Posted November 10, 2014 wow! 8D I am glad to help. Visit my repository Link to comment Share on other sites More sharing options...
kaisies Posted November 10, 2014 Share Posted November 10, 2014 Please note _FileListToArray is troublesome at time, and _FileListToArrayEx is more reliable: '?do=embed' frameborder='0' data-embedContent>> Link to comment Share on other sites More sharing options...
JohnOne Posted November 10, 2014 Share Posted November 10, 2014 What exactly is troublesome about _FileListToArray? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2014 Moderators Share Posted November 10, 2014 kaisies,Please note _FileListToArray is troublesome at timeSome examples please - otherwise how can we improve it. M23 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...
kaisies Posted November 10, 2014 Share Posted November 10, 2014 What exactly is troublesome about _FileListToArray? kaisies, Some examples please - otherwise how can we improve it. M23 That's what I've read on these forums, to the effect of that _FileListtoArray() uses the windows search function, and doesn't always return expected results. I could very well be mistaken, just trying to help Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2014 Moderators Share Posted November 10, 2014 kaisies,The only time I can remember there being any discussion about this matter was in this thread - which discussed why there were differences between the returns from _FileListToArray & _FileListToArrayRec (read the topic to find out ). These differences only arise when using pretty complicated wildcard filters where the standard Windows search used by _FileListToArray can indeed return results which appear not to match - although in the vast majority of cases the return is as expected. I added something to the Remarks section of both of these functions explaining that the user had to make a choice between speed and accuracy if the required filters were that complex. M23 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...
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