ziongates Posted January 25, 2008 Share Posted January 25, 2008 I'm writing scripts which result in running external programs which are passed arguments wrapeed in variables. The variables need to be in quotes. Is there an easier way to accomplish this than my messy code below? Specifically line $command where I have ($quote & $picture & $quote) $Picture = "E:\Timunah\§ Writers Conference\These\Smaller\Majestic Artz 13.jpg" $quote = ('"') $command = ($quote & $Picture & $quote) ShellExecute ("C:\Ancient\Indesign\Indesign Place.vbs", $command) Link to comment Share on other sites More sharing options...
BrettF Posted January 25, 2008 Share Posted January 25, 2008 I'm writing scripts which result in running external programs which are passed arguments wrapeed in variables. The variables need to be in quotes. Is there an easier way to accomplish this than my messy code below? Specifically line $command where I have ($quote & $picture & $quote)$Picture = "E:\Timunah\§ Writers Conference\These\Smaller\Majestic Artz 13.jpg"$quote = ('"')$command = ($quote & $Picture & $quote)ShellExecute ("C:\Ancient\Indesign\Indesign Place.vbs", $command)Like so?Run ('C:\Ancient\Indesign\Indesign Place.vbs "' & $quote & $picture & $quote &'"') Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
ziongates Posted January 25, 2008 Author Share Posted January 25, 2008 Like so?Run ('C:\Ancient\Indesign\Indesign Place.vbs "' & $quote & $picture & $quote &'"')Not really, specifically is there a way to insert quotes around my variables without creating a variable for the quote and using the "&" sign everytime I need to implement it. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted January 25, 2008 Share Posted January 25, 2008 Not really, specifically is there a way to insert quotes around my variables without creating a variable for the quote and using the "&" sign everytime I need to implement it.No... you have to use the & sign. It isn't that big of a deal. Link to comment Share on other sites More sharing options...
weaponx Posted January 25, 2008 Share Posted January 25, 2008 You can just nest the double quotes inside single quotes. $Picture = '"E:\Timunah\§ Writers Conference\These\Smaller\Majestic Artz 13.jpg"' ShellExecute ("C:\Ancient\Indesign\Indesign Place.vbs", $Picture) 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