rush4hire Posted July 21, 2006 Posted July 21, 2006 Like I'll have some files and a combo with those files listed. Lets say I have an .ini, some .txt files, a .jpg.. How do I like open the .jpg with the program that user uses to open .jpgs, and the text editor he uses to open an .ini, etc.. Run only works with EXE, BAT, COM, or PIF executable files. Thanks. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player
Moderators SmOke_N Posted July 21, 2006 Moderators Posted July 21, 2006 (edited) Like I'll have some files and a combo with those files listed. Lets say I have an .ini, some .txt files, a .jpg.. How do I like open the .jpg with the program that user uses to open .jpgs, and the text editor he uses to open an .ini, etc.. Run only works with EXE, BAT, COM, or PIF executable files. Thanks. Run('"' & $LocationAndApplication2OpenWithEXE & '" "' & $ItemLocationAndNameToOpen & '"') Edit: Here's an example:$ItemLocationAndNameToOpen = @ScriptDir & '\ExampleOpenText.txt' FileWrite($ItemLocationAndNameToOpen, 'This is how it works') $LocationAndApplication2OpenWithEXE = @SystemDir & '\Notepad.exe' Run('"' & $LocationAndApplication2OpenWithEXE & '" "' & $ItemLocationAndNameToOpen & '"') Sleep(5000) If MsgBox(36, 'Keep Open?', 'Would you like to keep the text file open?') = 7 Then $OptWTMM = Opt('WinTitleMatchMode', 2) If WinExists('ExampleOpenText') Then WinKill('ExampleOpenText') FileDelete($ItemLocationAndNameToOpen) EndIf Edited July 21, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
w0uter Posted July 21, 2006 Posted July 21, 2006 (edited) Ignore SmOke_N he is tired.http://www.autoitscript.com/autoit3/docs/faq.htm#6Run(@comspec & ' /c start ' & $s_yourfile) Edited July 21, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Moderators SmOke_N Posted July 22, 2006 Moderators Posted July 22, 2006 Ignore SmOke_N he is tired. http://www.autoitscript.com/autoit3/docs/faq.htm#6 Run(@comspec & ' /c start ' & $s_yourfile)I thought he wanted to open it up with any, your right... don't know how I got that from default.... but mine still works ... just have to know what they want to open it up with (could maybe have 2 options ). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
rush4hire Posted July 22, 2006 Author Posted July 22, 2006 Ok. Thanks very much. This works. Func showfiles($file) switch $file Case "gamma_setting.jpg" If not WinExists ("Gamma Setting") Then $picgui = GUICreate("Gamma Setting", 520, 240,-1,-1,-1,-1,$gui) GUICtrlCreatePic ( "gamma_setting.jpg", 8, 8, 506, 189 ) $okbut = GUICtrlCreateButton (" Ok ", 250, 210) GUISetState() EndIf Case Else If $file == "ddcodes_readme.txt" Then GUICtrlSetData ( $GUIbox1, $GUItext) Else GUICtrlSetData ( $GUIbox1, FileRead($file, FileGetSize ( $file )) ) ;~ MsgBox ( 0, "Sorry!", "These aren't working right yet."&@crlf&"But you should find these files somewhere in this folder."&@crlf&"For now I'll put the contents in the textbox here.", 10 ) EndIf Run(@comspec & ' /c start ' & $file) EndSwitch EndFunc It's a little wierd though, you see a command prompt window flashing before the file is open. Let's try that other method then.. brb. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player
Helge Posted July 22, 2006 Posted July 22, 2006 Run(@comspec & ' /c start ' & $file, '', @SW_HIDE) Marcelos 1
rush4hire Posted July 22, 2006 Author Posted July 22, 2006 Ok... This works great. I just usin a gui for the pic, and the ini and txts I can just do this: Run('"' & @SystemDir & '\Notepad.exe" "' & @ScriptDir &'\'& $file & '"') oÝ÷ Ø]¶©ÞßtáÌ(®K½éÛzÛ^«¢+ÙIÕ¸¡½µÍÁµÀìÌäì½ÍÑÉÐÌäìµÀìÀÌØí¥±°ÌäìÌäì°M]}!%¤oÝ÷ Øìµæ¡û¬x'¢×©iغǬ)èµêZu©mz¹Ú¶+ÞÂ+}ö=§S +mjG¬i¸àz»h¢§ÔájÝý²z)®åzka¢è! «¬zz0Áç붬~Ú)"Ú~)^!Ú'ßÛd"~+fjG¬j|÷ÞéÜzÚ)ºÔ®*m*íêÞnëbßÙe¶¼«m¢®¶se'Vâ6ö×7V2fײb33²ö27F'Bb33²fײ67&DF"fײb33²b3#²b33²fײb33c¶fÆRÂb33²b33²Â5uôDR Thanks! Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player
AzKay Posted July 22, 2006 Posted July 22, 2006 Run("Notepad.exe " & "document.rtf") # MY LOVE FOR YOU... IS LIKE A TRUCK- #
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