GaryFrost Posted March 25, 2006 Share Posted March 25, 2006 (edited) !!!! Warning..............!!!! This will work only if you have MS Devtools installedOR!!!! At your own risk !!!! follow the link in post 11Was just playing around with what Lapo shared in support (Originally from Svenp).I'm sure if someone wants to this could be expanded a bit more. Decided to share for all those that are always saying I ran the filedialog and no file opened.1st function reads file into edit control also shows how to save the text from edit control back to a file2nd function reads file into a variable3rd function reads file into a arrayall the above are done thru flags passed to the _FileDialog functionAlso showed how to use old style file dialog in 3rd functionEnjoy!!!Gary http://www.autoitscript.com/fileman/users/gafrost/projects/TestFileDialog.au3http://www.autoitscript.com/fileman/users/gafrost/projects/FileDialog.au3 Edited September 19, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ConsultingJoe Posted March 25, 2006 Share Posted March 25, 2006 wow A+ man. good job. Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
randallc Posted March 26, 2006 Share Posted March 26, 2006 Hi,Why can I never get objects and others can!!!!!$OpenDialog = ObjCreate("MSComDlg.CommonDialog")Gives me no object.I had this problem with RichTextEdit too...Do i need to set a permission or something?Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted March 26, 2006 Author Share Posted March 26, 2006 Hi,Why can I never get objects and others can!!!!!Gives me no object.I had this problem with RichTextEdit too...Do i need to set a permission or something?Best, randallWhat OS are you using?I'm using WinXP Pro SP2 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
randallc Posted March 26, 2006 Share Posted March 26, 2006 Hi,I'm using WinXP Pro SP2Yes, Same; with all updates as welltried on 2 separate computerss..Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted March 26, 2006 Author Share Posted March 26, 2006 Hi,Yes, Same; with all updates as welltried on 2 separate computerss..RandallNo clue, I ran this at work with no problems, and the security templates are a lot tighter at work. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Lapo Posted March 26, 2006 Share Posted March 26, 2006 No clue, I ran this at work with no problems, and the security templates are a lot tighter at work.WOW greatALL ok here win98se è IE 5.5sp2 Link to comment Share on other sites More sharing options...
MHz Posted March 26, 2006 Share Posted March 26, 2006 Hi, Yes, Same; with all updates as well tried on 2 separate computerss.. RandallYour not alone it seems. I also have XP Pro SP2 and it fails also . >"C:\Program Files\Autoit3\SciTe\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "D:\Scripts\AutoIt Scripts\Forum UDFs\TestFileDialog.au3" /autoit3dir "C:\Program Files\Autoit3\SciTe\..\Beta" /UserParams >Running AU3Check (1.54.1.1) params: from:C:\Program Files\Autoit3\SciTe\..\Beta +>AU3Check ended.rc:0 >Running:(3.1.1.115):C:\Program Files\Autoit3\SciTe\..\Beta\autoit3.exe "D:\Scripts\AutoIt Scripts\Forum UDFs\TestFileDialog.au3" D:\Scripts\AutoIt Scripts\Forum UDFs\FileDialog.au3 (128) : ==> Illegal text at the end of statement (one statement per line).: With $OpenDialog Only Object-type variables allowed in a WITH statement! +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 2.738 Link to comment Share on other sites More sharing options...
GaryFrost Posted March 26, 2006 Author Share Posted March 26, 2006 Your not alone it seems. I also have XP Pro SP2 and it fails also . >"C:\Program Files\Autoit3\SciTe\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "D:\Scripts\AutoIt Scripts\Forum UDFs\TestFileDialog.au3" /autoit3dir "C:\Program Files\Autoit3\SciTe\..\Beta" /UserParams >Running AU3Check (1.54.1.1) params: from:C:\Program Files\Autoit3\SciTe\..\Beta +>AU3Check ended.rc:0 >Running:(3.1.1.115):C:\Program Files\Autoit3\SciTe\..\Beta\autoit3.exe "D:\Scripts\AutoIt Scripts\Forum UDFs\TestFileDialog.au3" D:\Scripts\AutoIt Scripts\Forum UDFs\FileDialog.au3 (128) : ==> Illegal text at the end of statement (one statement per line).: With $OpenDialog Only Object-type variables allowed in a WITH statement! +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 2.738 Curious, do you have the same problem with the example for the richedit control in the beta help? It's in the GUICtrlCreateEdit example. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
MHz Posted March 26, 2006 Share Posted March 26, 2006 Curious, do you have the same problem with the example for the richedit control in the beta help? It's in the GUICtrlCreateEdit example.The Gui shows with the edit control containing standard text, but when closed, it shows Com error msgboxes as below --------------------------- AutoItCOM Test --------------------------- We intercepted a COM Error ! err.description is: 0 err.windescription: Class is not licensed for use err.number is: 80040112 err.lastdllerror is: 0 err.scriptline is: 32 err.source is: 0 err.helpfile is: 0 err.helpcontext is: 0 --------------------------- OK --------------------------- --------------------------- AutoItCOM Test --------------------------- We intercepted a COM Error ! err.description is: 0 err.windescription: The operation completed successfully. err.number is: FFFFFFFF err.lastdllerror is: 0 err.scriptline is: 43 err.source is: 0 err.helpfile is: 0 err.helpcontext is: 0 --------------------------- OK --------------------------- Similar problem showing in Scite's output pane >"C:\Program Files\Autoit3\SciTe\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\test.au3" /autoit3dir "C:\Program Files\Autoit3\SciTe\..\Beta" /UserParams >Running AU3Check (1.54.1.1) params: from:C:\Program Files\Autoit3\SciTe\..\Beta +>AU3Check ended.rc:0 >Running:(3.1.1.115):C:\Program Files\Autoit3\SciTe\..\Beta\autoit3.exe "C:\test.au3" C:\test.au3 (46) : ==> Illegal text at the end of statement (one statement per line).: With $oRP Only Object-type variables allowed in a WITH statement! +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 8.210 Link to comment Share on other sites More sharing options...
GaryFrost Posted March 26, 2006 Author Share Posted March 26, 2006 The Gui shows with the edit control containing standard text, but when closed, it shows Com error msgboxes as below --------------------------- AutoItCOM Test --------------------------- We intercepted a COM Error ! err.description is: 0 err.windescription: Class is not licensed for use err.number is: 80040112 err.lastdllerror is: 0 err.scriptline is: 32 err.source is: 0 err.helpfile is: 0 err.helpcontext is: 0 --------------------------- OK --------------------------- --------------------------- AutoItCOM Test --------------------------- We intercepted a COM Error ! err.description is: 0 err.windescription: The operation completed successfully. err.number is: FFFFFFFF err.lastdllerror is: 0 err.scriptline is: 43 err.source is: 0 err.helpfile is: 0 err.helpcontext is: 0 --------------------------- OK --------------------------- Similar problem showing in Scite's output pane >"C:\Program Files\Autoit3\SciTe\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\test.au3" /autoit3dir "C:\Program Files\Autoit3\SciTe\..\Beta" /UserParams >Running AU3Check (1.54.1.1) params: from:C:\Program Files\Autoit3\SciTe\..\Beta +>AU3Check ended.rc:0 >Running:(3.1.1.115):C:\Program Files\Autoit3\SciTe\..\Beta\autoit3.exe "C:\test.au3" C:\test.au3 (46) : ==> Illegal text at the end of statement (one statement per line).: With $oRP Only Object-type variables allowed in a WITH statement! +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 8.210 Ok, after some searching, it appears this is a problem if you don't have any ms dev tools installed, being a programmer, i have dev tools installed, there is a work around, be it at your own risk. http://www.codecomments.com/IE_Scripting/message315992.html SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Rick Posted March 26, 2006 Share Posted March 26, 2006 (edited) I asked about a multiple fileopendialogue all lastweek, and altho with flags it can be created the pending result does not give whats actually been selected only the folder ie: with $cdlOFNAllowMultiselect, it doesnt work in the example given shame that, still i guess autoit cant do everthing. Edited March 26, 2006 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
GaryFrost Posted March 26, 2006 Author Share Posted March 26, 2006 (edited) I asked about a multiple fileopendialogue all lastweek, and altho with flags it can be created the pending result does not give whats actually been selected only the folder ie: with $cdlOFNAllowMultiselect, it doesnt work in the example given shame that, still i guess autoit cant do everthing. Has nothing to do with autoit. #include <Array.au3> #include "FileDialog.au3" Opt("MustDeclareVars", 1) _Main_Multiple_Select() Func _Main_Multiple_Select() Local $file, $a_file Local $Caption = "Choose the file you want to open...", $Default_File = "" Local $Filter = "AutoIt (*.au3;*.aut)|*.au3;*.au3|Text (*.txt)|*.txt|ALL (*.*)|*.*" Local $Default_Index = 1, $Dialog = 0 Local $Flags = BitOR($cdlOFNFileMustExist, $cdlOFNPathMustExist, $cdlOFNNoChangeDir, $cdlOFNAllowMultiselect, $cdlOFNLongNames); old style dialog $file = _FileDialog ($a_file, $Caption, @ScriptDir, $Default_File, $Filter, $Default_Index, $Flags, $Dialog) If @error Then _DialogError() Else $file = StringSplit($file," ") _ArrayDisplay($file, "Multiple File Select") EndIf EndFunc ;==>_Main_Into_Array Func _DialogError() MsgBox(0, "File Dialog", "Intercepted an Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $DialogError.description & @CRLF & _ "err.number is: " & @TAB & Hex($DialogError.number, 8) & @CRLF & _ "err.scriptline is: " & @TAB & $DialogError.scriptline & @CRLF) EndFunc ;==>_DialogError Edited March 26, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Rick Posted March 26, 2006 Share Posted March 26, 2006 i was referring to the example with the proper filedialogue screen, not the smaller one showing shortfoldernames Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
GaryFrost Posted March 26, 2006 Author Share Posted March 26, 2006 (edited) i was referring to the example with the proper filedialogue screen, not the smaller one showing shortfoldernamesThat can probably be done also, just haven't figured it out yet, the one that works is space delimited, the other is null delimited.Didn't know one was improper. Edited March 26, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Squeeto Posted August 28, 2006 Share Posted August 28, 2006 Hi, I just downloaded and tried your FileDialog and TestFileDialog and I get this. Did I miss something? Link to comment Share on other sites More sharing options...
GaryFrost Posted August 28, 2006 Author Share Posted August 28, 2006 Hi, I just downloaded and tried your FileDialog and TestFileDialog and I get this. Did I miss something?What version of AutoIt are you using? SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Squeeto Posted August 28, 2006 Share Posted August 28, 2006 What version of AutoIt are you using?Version 3.2.0.1I didn't compile (convert to executable) it though. But all the other examples test just fine by opening the au3 file from autoit3.exe. Link to comment Share on other sites More sharing options...
GaryFrost Posted August 28, 2006 Author Share Posted August 28, 2006 Version 3.2.0.1I didn't compile (convert to executable) it though. But all the other examples test just fine by opening the au3 file from autoit3.exe.I've re-tried it on two different systems, no compiling, both ran fine.Both are WinXP Pro SP2 tho.I'll test on W2K and W98 and see what happens. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted August 28, 2006 Author Share Posted August 28, 2006 Ok, tried on 2k box that I don't have MS Dev Tools installed, got the same problem. Follow the link on post #11 I tried it and the script worked on 2k SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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