Metadata values in a script

Post Reply
OGSNorden
Newbie
Posts: 3
Joined: Mon Mar 07, 2011 1:17 pm

Metadata values in a script

Post by OGSNorden »

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
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Metadata values in a script

Post by dkelly »

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
OGSNorden
Newbie
Posts: 3
Joined: Mon Mar 07, 2011 1:17 pm

Metadata values in a script

Post by OGSNorden »

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








dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Metadata values in a script

Post by dkelly »

Try the following snippet





var MyDir = new Dir("c:tmp");

var MyFiles = MyDir.entryList("*.jpg", Dir.Files, Dir.Name);

job.log(1, MyFiles.toString());

OGSNorden
Newbie
Posts: 3
Joined: Mon Mar 07, 2011 1:17 pm

Metadata values in a script

Post by OGSNorden »

Thank you. It works
Post Reply