Jump to content

Recommended Posts

Posted

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)

Posted

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 &'"')

Posted

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.

Posted

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.

Posted

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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...