computergroove Posted May 19, 2014 Share Posted May 19, 2014 (edited) I need to send a command to Media Player Classic where I tell it the name of the video file I want it to play. My script works now if the video file does not have any spaces. If I can surround the file name with " then it will work. How do I add " to the following? Run (@ScriptDir & "MPC-HCmpc-hc64.exe /play /fullscreen /close "&$video_file&"") So $video_file will come out looking like "Dragon Slayer.mpg" instead of Dragon Slayer.mpg Edited May 19, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Jfish Posted May 19, 2014 Share Posted May 19, 2014 "&'"'&$video_file&'"'& Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
computergroove Posted May 19, 2014 Author Share Posted May 19, 2014 (edited) "&'"'&$video_file&'"'& Run (@ScriptDir & "\MPC-HC\mpc-hc64.exe /play /fullscreen /close "&'"'&$video_file&'"'") Returns error: syntax error (illegal character) Edited May 19, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
jguinch Posted May 19, 2014 Share Posted May 19, 2014 You will find the same answer and the explanation in the help file : Language Reference / Datatypes (String section) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
jguinch Posted May 19, 2014 Share Posted May 19, 2014 computergroove, remove the last " in you last code Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JohnOne Posted May 19, 2014 Share Posted May 19, 2014 $video_file = '"Dragon Slayer.mpg"' MsgBox(0,0,$video_file) 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...
sahsanu Posted May 19, 2014 Share Posted May 19, 2014 (edited) This should work fine: Run(@ScriptDir & '\MPC-HC\mpc-hc64.exe /play /fullscreen /close "' & $video_file & '"') Edit: JohnOne suggested a nice approach to solve the problem Cheers, sahsanu Edited May 19, 2014 by sahsanu Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Share Posted May 19, 2014 Opt("ExpandVarStrings", 1) $video_file = "Dragon Slayer.mpg" ConsoleWrite("@lf@Here the string:@lf@") ConsoleWrite("@ScriptDir@\MPC-HC\mpc-hc64.exe /play /fullscreen /close ""$video_file$""") Run("@ScriptDir@\MPC-HC\mpc-hc64.exe /play /fullscreen /close ""$video_file$""") ConsoleWrite("@lf@@lf@") App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
computergroove Posted May 19, 2014 Author Share Posted May 19, 2014 This should work fine: Run(@ScriptDir & '\MPC-HC\mpc-hc64.exe /play /fullscreen /close "' & $video_file & '"') Edit: JohnOne suggested a nice approach to solve the problem Cheers, sahsanu This worked. Thanks everyone Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html 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