Search found 40 matches

by automation
Wed Sep 02, 2020 10:32 am
Forum: LEGACY scripting
Topic: Script expression isFolder not working
Replies: 0
Views: 7653

Script expression isFolder not working

Wen I use below my folder in "Folder 1" is not going to "Folder 2". Why? My goal is. If Folder 1 contains a s folder, I want to get the the folder name in a variable and use it later in SwitchScripter. The folder should to to "Folder 2" If Folder 1 have a file (not a fo...
by automation
Thu Aug 27, 2020 7:52 pm
Forum: LEGACY scripting
Topic: Pass in/out path to jar file with switchscripter?
Replies: 2
Views: 3366

Pass in/out path to jar file with switchscripter?

I have a Java JAR file i execute with switchscripter. The JAR file need two parameters, in, the folder before, and out next folder. File in to the jar file is not the same as out from JAR, it's a modified copy. I need to pass the copy to the next folder and trow away the original input file. How sho...
by automation
Tue Jul 07, 2020 9:17 am
Forum: LEGACY scripting
Topic: Access Switchscripter error in mail body (next module)
Replies: 1
Views: 2804

Access Switchscripter error in mail body (next module)

I have a switchscripter with a trafic light. If the scripts fails (error) the xml goes to the next model, mail send and this is working. In my switchscripter code I have this loggin and I get the errors fine in the log. job.fail( "Process shipment marking failed with the status code %1", t...
by automation
Tue Apr 07, 2020 11:56 am
Forum: Switch
Topic: Embed image into html email? How do I use a cid image?
Replies: 1
Views: 3981

Embed image into html email? How do I use a cid image?

How can I add an image under <body> in html send email with my own email template? I've tested with base64 but it doesn't work outlook. If I look at the enfocus email template it use <img src="cid:switch_html_img_header.jpg" width="536" height="176" alt="" /> ...
by automation
Tue Jan 21, 2020 4:31 pm
Forum: LEGACY scripting
Topic: Get return value from Java class file in Switchscripter
Replies: 1
Views: 3393

Get return value from Java class file in Switchscripter

I execute a java class (see java code below) like this in SwitchScripter var status = Process.execute("java -cp " + path + " XSDValidator " + xtdPath + " " + sourcePath); It works fine and I can get the println like this s.log(3, "Java message stdout: %1", Pro...
by automation
Fri Dec 13, 2019 3:05 pm
Forum: LEGACY scripting
Topic: job.getPath() can't find the file
Replies: 6
Views: 10319

Re: job.getPath() can't find the file

freddyp wrote: Tue Dec 10, 2019 2:36 pm job.getPath() will most likely contain spaces so you have to quote the value when using it on the command line:

Code: Select all

var myJob = "\"" + job.getPath() + "\"";
The same goes for any other file path on the command line.
WOW thanks it worked! So simple but hard to find.
by automation
Fri Dec 06, 2019 12:10 pm
Forum: LEGACY scripting
Topic: job.getPath() can't find the file
Replies: 6
Views: 10319

Re: job.getPath() can't find the file

Try this instead var myJob = job.getPath(); And then var status = Process.execute("java -jar " + scriptPath + " -trimBox " + startX + "," + startY + "," + xmlWidth + "," + xmlHeight + " -sourceFile " + myJob + " -destFile C:/trimmed.p...
by automation
Thu Dec 05, 2019 4:42 pm
Forum: LEGACY scripting
Topic: job.getPath() can't find the file
Replies: 6
Views: 10319

job.getPath() can't find the file

I'am trying to run jar-file and it's working find if I'am not using variables like this var status = Process.execute("java -jar C:/pdfboxer.jar -trimBox 55.94803135054997,56.82283454999998,1164.1039372989,765.3543309 -sourceFile C:/myfile.pdf -destFile C:/trimmed.pdf"); If I run the code b...
by automation
Tue Dec 03, 2019 4:33 pm
Forum: LEGACY scripting
Topic: Call function ONE time if I have two incoming files?
Replies: 7
Views: 18188

Re: Call function ONE time if I have two incoming files?

I think there's more than a few ways to handle this. Here are a couple of ideas: you could consume the XML as a dataset and attach it to the PDF with a metadata pickup. Then, you could send in the PDF and access the XML as a dataset within scripter. Another option would be to hold and assemble to p...
by automation
Tue Dec 03, 2019 2:58 pm
Forum: LEGACY scripting
Topic: Call function ONE time if I have two incoming files?
Replies: 7
Views: 18188

Re: Call function ONE time if I have two incoming files?

In the FileStatistics class you can use getByteCount( ) : Number http://www.enfocus.com/manuals/DeveloperGuide/SW/18/home.html#en-us/common/sw/reference/r_filestatistics_class.html Hi! I don't think you understand my question. I get the Width of the pdf (not the file size). and I read a Width from ...
by automation
Tue Dec 03, 2019 1:58 pm
Forum: LEGACY scripting
Topic: Call function ONE time if I have two incoming files?
Replies: 7
Views: 18188

Call function ONE time if I have two incoming files?

I have switchscripter with two incoming files (one xml and one pdf). I get the size of them both and want to sum the size of the two files. I have tested a log but can't find out how I get ONE result (the calculated size) if I have two incoming files. I have tested to move the function outside the j...
by automation
Fri Nov 29, 2019 12:06 pm
Forum: LEGACY scripting
Topic: Switchscripter can't combine value from pdf and xml in one variable
Replies: 2
Views: 7959

Switchscripter can't combine value from pdf and xml in one variable

I have a script in Switchscripter with incoming one pdf and one XML. If the job is XML I get the value from the XML (works inside the function) if the job is a PDF I get the size of the PDF (works inside the function) But when I "convert mm to pt" I get two values in trimBoxWidht and trimB...
by automation
Fri Oct 25, 2019 10:36 am
Forum: Flows
Topic: Use headers or separations/parts in a flow?
Replies: 4
Views: 11410

Use headers or separations/parts in a flow?

I have flow to one customer. But the flow consists of three different parts (for example, orders, customer and feedback). Is it possible to draw a line within a flow to separate it into different parts or add headers within a flow?

See my examples below.
by automation
Tue Oct 15, 2019 10:12 am
Forum: Flows
Topic: Update pdf metadata from XML? XMP Inject?
Replies: 6
Views: 8256

Re: Update pdf metadata from XML? XMP Inject?

You are awesome! Thanks, it works! I see 8-) ... You have first to combine PDF and XML with XML Pickup. Capture d’écran 2019-10-11 à 16.28.24.png The simple way is to add 2 files with same name (150307.pdf and 150307.xml) so XML Pickup setup is "Metadata alongside asset". OR you can also a...
by automation
Fri Oct 11, 2019 4:15 pm
Forum: Flows
Topic: Update pdf metadata from XML? XMP Inject?
Replies: 6
Views: 8256

Re: Update pdf metadata from XML? XMP Inject?

Can you send me your flow and a sample of PDF and XML ? Hi! I have addad a .zip with the flow. I put test.pdf and 150307.xml in "PDF + XML IN". template.xmp is the template I use. error.png is an error I get in the log. I get an empty metatag "test" in the pdf that contains widt...