Hello,
i want to get some metadata value as strings in my script-element.
This line is ok:
Test = job.getVariableAsString("[job-name"]");
But at this line i get the error massage "Parse Error: parse error"
Test = job.getVariableAsString("[Metadata.Text:Path="/auftrag/info",Dataset="Xml",Model=XML]");
Whats wrong with the script. How can i get the information from the XML-File in my script
Metadata values in a script
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Metadata values in a script
You need to escape the quote characters inside of the string.
Test = job.getVariableAsString("[Metadata.Text:Path="/auftrag/info",Dataset="Xml",Model=XML]");
Dwight Kelly
Apago, Inc.
dkelly@apago.com
Test = job.getVariableAsString("[Metadata.Text:Path="/auftrag/info",Dataset="Xml",Model=XML]");
Dwight Kelly
Apago, Inc.
dkelly@apago.com
Metadata values in a script
Thank you. It works fine.
Now i had a second question.
I don't unterstand the dir-function in switchscript.
I want list all JPG Files in an directory. Like this:
MyDir = Dir("/c/tmp/");
MyFiles = MyDir.entryList("*.jpg", Dir.Files, Dir.Name);
Whats wrong with this lines and how i can get a list of all jpg-files in C:tmp
Now i had a second question.
I don't unterstand the dir-function in switchscript.
I want list all JPG Files in an directory. Like this:
MyDir = Dir("/c/tmp/");
MyFiles = MyDir.entryList("*.jpg", Dir.Files, Dir.Name);
Whats wrong with this lines and how i can get a list of all jpg-files in C:tmp
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Metadata values in a script
Try the following snippet
var MyDir = new Dir("c:tmp");
var MyFiles = MyDir.entryList("*.jpg", Dir.Files, Dir.Name);
job.log(1, MyFiles.toString());
var MyDir = new Dir("c:tmp");
var MyFiles = MyDir.entryList("*.jpg", Dir.Files, Dir.Name);
job.log(1, MyFiles.toString());
Metadata values in a script
Thank you. It works