Skip to main content
Known Participant
July 4, 2017
Answered

cSavepath not saving based on if then statements

  • July 4, 2017
  • 1 reply
  • 1078 views

HI,

I am trying to make it so if the total number of pages (numPages) is 1, then the code inserts the "1" +  "page" and if there is a total of 3 pages , it would insert save as "3" + "pages".  I don't understand why the following is not saving the pdf with the cSavePath (i.e., filename) based on whether the total # of pages is 1 or not 1:

        cSavePath += " - "

        cSavePath += event.target.numPages

        If (event.target.numPages == "1")

       {cSavePath += " page"}

        

        If (event.target.numPages != "1")

        {cSavePath += " pages"}

    

I even tried as numerical value:

cSavePath += " - "

        cSavePath += event.target.numPages

        If (event.target.numPages = 1)

       {cSavePath += " page"}

        

        If (event.target.numPages > 1)

        {cSavePath += " pages"}

This topic has been closed for replies.
Correct answer try67

Also, it's "if", not "If"...

1 reply

Bernd Alheit
Community Expert
Community Expert
July 4, 2017

Use == not = for the comparsion.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 4, 2017

Also, it's "if", not "If"...

suemo22Author
Known Participant
July 4, 2017

Ughh, yes.  It was the "If" vs. the "if".  Thx.