Search found 346 matches

by LasseThid
Tue Mar 31, 2015 8:01 am
Forum: LEGACY scripting
Topic: Send Switch Stat variables to JavaScript
Replies: 10
Views: 9640

Re: Send Switch Stat variables to JavaScript

Thanks Andrea.
That's may make life a bit easier for me. :lol:

Update:
I can't figure out how to use Round() in my calculation.
[Switch.Calculation:Expression="Round([Stats.TrimBoxWidth]/72*25.4)"] results in the value 0 instead of the expected 90.
by LasseThid
Mon Mar 30, 2015 4:11 pm
Forum: LEGACY scripting
Topic: Send Switch Stat variables to JavaScript
Replies: 10
Views: 9640

Re: Send Switch Stat variables to JavaScript

dkelly wrote:

Code: Select all

var width = job.getVariableAsNumber("[Stat.TrimboxWidth]"); 
var height = job.getVariableAsNumber("[Stat.TrimboxHeight]"); 
Thank you very much.
by LasseThid
Mon Mar 30, 2015 4:10 pm
Forum: LEGACY scripting
Topic: Send Switch Stat variables to JavaScript
Replies: 10
Views: 9640

Re: Send Switch Stat variables to JavaScript

Hello, You don't need necessarily use Javascript. You may use the built-in functions "Calculation" Aleksander The problem with the Switch Calculation is that you get atleast one decimal and HP SmartStream Designer Imposition is not able to import an imposition containing a . in the file name, i.e. ...
by LasseThid
Mon Mar 30, 2015 10:32 am
Forum: LEGACY scripting
Topic: Send Switch Stat variables to JavaScript
Replies: 10
Views: 9640

Send Switch Stat variables to JavaScript

Is it possible to somehow use the Stat.TrimboxWidth and Stat.TrimboxHeight variables in a JavaScript for use in a calculation?
I need to somehow calculate the width and height of a pdf in millimeters without decimals and then send the result back to switch.
by LasseThid
Mon Mar 30, 2015 10:26 am
Forum: Preflighting
Topic: Switch Developer Server
Replies: 3
Views: 6059

Re: Switch Developer Server

Thanks for the information Thomas.
I will look in to that.
by LasseThid
Fri Mar 27, 2015 3:01 pm
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

Thanks to everyone who has helped me with this script. *thumbsup* When I changed the workspace from Design to Run I noticed there was an error in line 17 of the script, (Use of undefined variable 'runLength') :oops: . I added qoutes around runLength and started the flow and now the file went to the ...
by LasseThid
Fri Mar 27, 2015 12:42 pm
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

I copied your code and pasted it into SwitchScripter and this time I didn't get the syntax error I got last time I had the quotes... Unfortunately the pdf is still stuck in the PDF with metadata folder, I though the job.sendToSingle was the part that would tell Switch to send the job along, but perh...
by LasseThid
Fri Mar 27, 2015 10:25 am
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

I added the code in SwitchScripter, but I had to do some modifications in order to be able to save it (syntax errors), but when I run the flow the pdf is not processed by the Script element, it just sits in the PDF with Metadata folder, so obviously there's something I have missed. Any Ideas? functi...
by LasseThid
Thu Mar 26, 2015 3:15 pm
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

Aha... so instead of

Code: Select all

var theWidth = theDataset.evalToNumber( ”/xslt/to/width” )
I should type

Code: Select all

var theWidth = theDataset.evalToNumber( ”/order/products/product/width” )
and so on? Should I keep the " or remove them?
by LasseThid
Thu Mar 26, 2015 10:29 am
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

Ok, let's see how much I misunderstood of your comments and scripts... :lol: The XML I get looks like this: <?xml version="1.0" encoding="UTF-8"?> <order> <ordernumber>P14166</ordernumber> <system>customerX</system> <products> <product> <filename>P14166_businesscard.pdf</filename> <type>businesscard...
by LasseThid
Wed Mar 25, 2015 10:25 pm
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

Thank you very much for your comments and suggestions. I will look it in to it as soon as I can. Unfortunately JavaScript is still new to me, I started to learn it online about two weeks ago :D , so I need to find some time to analyze your scripts in order to understand them. Regarding the folder na...
by LasseThid
Wed Mar 25, 2015 12:26 pm
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Re: Run length calculation

I am using the xml pickup to embed the xml as metadata (Metadata alongside asset) in order to use the metadata to pick up the correct imposition for the job, but I don't know how to access that metadata with a Javascript or if it would be easier to get the information from the xml file. Currently th...
by LasseThid
Tue Mar 24, 2015 8:02 pm
Forum: Flows
Topic: Run length calculation
Replies: 15
Views: 9864

Run length calculation

I'm working on a flow where I get an XML file for each PDF containing amongst other things number of ordered copies, height and width of the product. From this information I need to calculate how many sheets we need to print in order to print the ordered number of copies. As I know the sheet size I ...
by LasseThid
Tue Mar 24, 2015 3:19 pm
Forum: Imposition
Topic: Smartstream causing InDesign to crash
Replies: 4
Views: 7529

Re: Smartstream causing InDesign to crash

The test flow that I set up looks like this: In folder -> HP SmartStream Designer Imposition -> Out folder, with additional folders for logs and errors. When dropping a pdf file in the In folder InDesign would start up and then crash sending the pdf and an xml-file to the logs folder. Today I receiv...
by LasseThid
Wed Mar 11, 2015 6:42 pm
Forum: Imposition
Topic: Smartstream causing InDesign to crash
Replies: 4
Views: 7529

Smartstream causing InDesign to crash

I'm trying to create a Switch flow that will position an incoming pdf on an imposition created by Smartstream, but even at it's simplest form, i.e. a folder for the incoming file, HP Smartstream Imposition and a folder for the output, the only result I get is InDesign crashing. I created the imposit...