0

How can I pass a filename variable into the following line?

var image = dymo.label.framework.loadImageAsPngBase64("http://www.example.com/label.png");

The following obviously doesn't work, tried single quotes and several different variations but none of it worked.

var file_name = "label.png";
var image = dymo.label.framework.loadImageAsPngBase64("http://www.example.com/" + file_name + ");
Paolo
  • 20,112
  • 21
  • 72
  • 113
dean2020
  • 645
  • 2
  • 8
  • 25
  • Does `loadImageAsPngBase64("http://www.example.com/" + file_name);` not work? (Without the last plus sign) – JCOC611 Dec 09 '19 at 22:54
  • What's the last `"`? The one after `file_name + ` and before `);` – Wenbo Dec 09 '19 at 22:54
  • The last + should not be there. I had tried without it as well. The problem was actually that in the script file_name was an object. I added ".value" and it worked. Thank you both. – dean2020 Dec 10 '19 at 07:46

1 Answers1

0

Solved: issue was with the variable in the script. It was an object so I had to add .value to obtain to obtain the value.

dean2020
  • 645
  • 2
  • 8
  • 25