Werty Posted August 8, 2010 Share Posted August 8, 2010 (edited) I have this imagemagick command where I need to put the #80008000 part in quotes like this "#80008000". The command looks like this $img.Convert("input.bmp","-fill","#80008000","-opaque","white","output.bmp") But that doesnt put the #80008000 part in quotes. Actually the command needs to be.... $img.Convert("input.bmp","-fill","#",$MyVar,"-opaque","white","output.bmp") So the "#",$MyVar part needs to be in quotes. So where the H do I put quotes to make it look like that ? I end up with a gazillion """""""""" and it still fails. Edited August 8, 2010 by Werty Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
seandisanti Posted August 8, 2010 Share Posted August 8, 2010 I have this imagemagick command where I need to put the #80008000 part in quotes like this "#80008000".The command looks like this$img.Convert("input.bmp","-fill","#80008000","-opaque","white","output.bmp")But that doesnt put the #80008000 part in quotes.Actually the command needs to be....$img.Convert("input.bmp","-fill","#",$MyVar,"-opaque","white","output.bmp")So the "#",$MyVar part needs to be in quotes.So where the H do I put quotes to make it look like that ?I end up with a gazillion """""""""" and it still fails. looks like you have an extra comma after your "#" that will probably cause you some issues Link to comment Share on other sites More sharing options...
Werty Posted August 8, 2010 Author Share Posted August 8, 2010 looks like you have an extra comma after your "#" that will probably cause you some issueslol, you're right, still need it in quotes though.Looks like this now...$img.Convert("input.bmp","-fill","#" & Hex($color,8),"-opaque","white","g:/result.png")...where the quotes are missing. Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Tvern Posted August 8, 2010 Share Posted August 8, 2010 (edited) There are two main ways to do this:1. Escape the quotes you want to appear in the string like this: "unquoted part of the string, ""quoted part of the string""".The red quotes are the opening and closing quotes for the string, while the green ones will show up in the string. by using two double quotes the interpeter knows these are not meant to be closing quotes for the string, but part of the string.This would look like: """#" & Hex($color,8) & """"2. Use single quotes to contain the string, and double quotes where you need them in the string like this: 'unquoted part of the string, "quoted part of the string"'.Again the red quotes delimit the string, while the green ones show up. Because the string is opened with a single quote, the interpeter won't think the double quote is meant to close it.This would look like: '"#' & Hex($color,8) & '"'P.s. If you need to format a string containing both double and single quotes you need to combine both methods, or form the different parts of the string first, then concatenate them.edit: If you are having trouble formatting a string it usually helps to test it by consolewriting to the console in addition, or instead of trying to run it right away. Edited August 8, 2010 by Tvern Link to comment Share on other sites More sharing options...
cueclub Posted August 9, 2010 Share Posted August 9, 2010 (edited) the way I do it is.. something like this.. Msgbox(0, "test", " you're message 'HERE' ") but my eyes are bad and i dont want to look at all those quotes . Edited August 9, 2010 by cueclub Link to comment Share on other sites More sharing options...
Werty Posted August 9, 2010 Author Share Posted August 9, 2010 Thanks, got it. Nice explanation. Some guy's script + some other guy's script = my script! 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