Search found 15 matches

by menglv
Thu Mar 27, 2014 5:34 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

freddyp wrote: If job.log(2,currentbook); gives you a correct value in the messages. And currentbook; as the last line of your script generates and undefined error message, you are doing something wrong. You may want to check there are no lines with spaces after the last line. Freddy Problem is: cur...
by menglv
Wed Mar 26, 2014 4:58 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

freddyp wrote: Then just write



currentbook;



as the last line of your script expression. I thought that was clear from the explanation.



Freddy


job.log(2,currnetbook)



The line above can see the variables return a value, but this value is undifined
by menglv
Tue Mar 25, 2014 6:50 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

freddyp wrote: Freddy


Theresult of this variable is not important, the key is currentbook which returned the result is undefined. I want this currentbook value equals pdf's PageHeight.
by menglv
Sat Mar 22, 2014 1:45 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

dkelly wrote: Your script doesn't follow the example I gave. You are not using the FileStatistics variable curFileStats to retrieve the PageHeight.






return value:undefined



Does anyone know what is the reason?
by menglv
Thu Mar 20, 2014 5:39 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

dkelly wrote: Your script doesn't follow the example I gave. You are not using the FileStatistics variable curFileStats to retrieve the PageHeight.






return value:undefined
by menglv
Sun Mar 16, 2014 1:08 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

dkelly wrote: If your job is a single file use:



var curFileStats = new FileStatistics(job.getPath());

currentbook = curFileStats.getNumber("PageWidth");


I tried, but without success.

Can you give me an example of flow?







test.sflow
by menglv
Thu Mar 13, 2014 4:07 am
Forum: Scripting
Topic: How can I debug a value of a variable in JavaScript?
Replies: 5
Views: 3080

How can I debug a value of a variable in JavaScript?

var re ="5454564";

var s=Switch;

s.log(1,"variable = " + re);



TypeError. Undefined member function 'log' for object '[object FactoryObject]' of type: 'FactoryObject'
by menglv
Thu Mar 13, 2014 4:05 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

how to use function FileStatistics?
by menglv
Thu Mar 13, 2014 12:37 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

dkelly wrote: Is your job a file or folder?


my job is a file.
by menglv
Wed Mar 12, 2014 2:27 pm
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

var re =job.getPath();

re=re.mid(0,re.findRev("/")) + "/"+job.getName();

var curFileStats = new FileStatistics(re);

currentbook = curFileStats.getNumber("PageWidth");



why can't work?
by menglv
Wed Mar 12, 2014 1:17 pm
Forum: Scripting
Topic: Iterating through documents in job using scriptexpression
Replies: 7
Views: 3731

Iterating through documents in job using scriptexpression

Looks as if it is unable to work.
by menglv
Wed Mar 12, 2014 1:00 pm
Forum: Scripting
Topic: How can I debug a value of a variable in JavaScript?
Replies: 5
Views: 3080

How can I debug a value of a variable in JavaScript?

How can I debug a value of a variable in JavaScript?

thanks
by menglv
Wed Mar 12, 2014 12:29 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

Really worked, thank you very much.
by menglv
Tue Mar 11, 2014 8:13 am
Forum: Scripting
Topic: PageWidth how to assign a value to a variable?
Replies: 17
Views: 11863

PageWidth how to assign a value to a variable?

PageWidth how to assign a value to a variable?

How to use PageWidth variable in JavaScript?