2 Replies Latest reply: Nov 16, 2011 1:17 PM by scripternovice RSS

    Is There a Syntax Error in Adobe's ResizeCanvas Method for PS5 VBScript?

    scripternovice

      Shown below is a sample script which opens Photoshop and adds the expected 6 x 6 document:

       

      Set appRef=CreateObject("Photoshop.Application")

      Set docRef=appRef.Documents.Add(13,9)

      docWidth=docRef.Width

      docHeight=docRef.Height

      docRef.ResizeCanvas docWidth-7,docHeight-3

       

      However, if I use the syntax for ResizeCanvas method shown on P. 63 of the "Adobe Photoshop CS5 VBScript Scripting Reference", the last line of script becomes that shown below:

       

      Set appRef=CreateObject("Photoshop.Application")

      Set docRef=appRef.Documents.Add(13,9)

      docWidth=docRef.Width

      docHeight=docRef.Height

      docRef.ResizeCanvas (docWidth-7,docHeight-3)

       

      When executed, the error message "Cannot use parentheses when calling a Sub" appears.  Can someone please explain this?

       

      Message was edited by: scripternovice