Open printing to pdf

Richard Gaskin ambassador at fourthworld.com
Wed May 13 02:55:36 EDT 2020


GEORGE WOOD wrote:

 > Here is on example of what I tried:
 >
 > on mouseup
 >  put “⁩/Desktop⁩/test files/Test.pdf” into temp
 >  open printing to pdf temp
 >  print cd 1 from (topleft of cd 1) to (bottomright of cd 1)
 >  close printing
 >  put the result
 > end mouseup

"the result" returns exception info for the last command executed. In 
that case it's the "close printing" command.

Move it a line up and it'll tell you what's happening with the print 
command.

But add an error-check just after "open printing..." and I'll bet you'll 
find the culprit:

You path begins with "/", which signifies the root of the volume.  But 
"Desktop" is in the root, it's in the user's Home folder at (assuming Mac):

   /Users/<yourname>/Desktop/

Using specialFolderPath("Desktop") will always return the correct path 
on all platforms with a Desktop.

But in your case, you can do something even simpler:

   put "~/Desktop/test files/Test.pdf" into temp

The leading "~" is shorthand for the current user's folder.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list