Author Topic: Q8 : Export to PDF Automation AppleScript - need code clue  (Read 5194 times)

0 Members and 1 Guest are viewing this topic.

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Q8 : Export to PDF Automation AppleScript - need code clue
« on: April 02, 2009, 07:27:25 PM »
i just started quark 8 and am trying to get some automation going to help with simple tasks.
i know newbies ask the dumbest question, but i'm so new i dont even know what (specifics) to ask...
Task One: open file, export to pdf (using export profile or specify crops and bleeds), save in same folder (name "layout".pdf), close qxd file.

i know this code below doesnt work, and i suck at syntax. also does the "pdf suite" come standard with q8 or do i need to do something special??

   tell application "QuarkXPress"
      export layout space 1 of project 1 as pdf to Front Finder window
      set output style to "NoCrops"
   end tell
if anyone can help or point me in the right direction. i have lots of books and online resources, but its a lot to take in, and a little win here would be motivating.

Eventually i'll need to apply "export to pdf" and "Collect" to several documents each in individual job folders.... but baby steps for now.

any help would be ehrm... really helpful.
thanks.

Offline tttexter

  • Visitor
  • Posts: 4
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #1 on: April 03, 2009, 08:06:49 AM »
Try this:

tell application "QuarkXPress"
   open file "Macintosh HD:yourpath:yourfile.qxd"
   export layout space 1 of project 1 in ("Macintosh HD:yourpath:yourfile.pdf") as "PDF" PDF output style "yourstyle"
end tell

You will get an error if the pdf file already exists.

Good luck!

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #2 on: April 03, 2009, 11:58:26 AM »
THANKS tttexter!!

It worked just as you said it would. I REALLY appreciate the help. I just needed the structure and would not have thought to word it that way (using the "in") and "as PDF" without the "s wasnt working either.

Much appreciated!

Offline nellbern

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #3 on: June 24, 2009, 07:57:45 PM »
tttexter,
Your script is really good but I'm curious how the pdf is made. I have my Quark preferences set up to create a .ps file for later distilling & a hot folder where those .ps files are distilled. With your method it creates a PDF but I don't know how is made and which Adobe Distiller PDF settings are used (PDF/X 1a). Do you mind, if possible, to explain. Please :)

Offline tttexter

  • Visitor
  • Posts: 4
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #4 on: June 25, 2009, 06:01:01 AM »
Hi Nell

If you have set the documents pdf preferences to create a ps-file (as you did) this one will work:

tell application "QuarkXPress"
   open file "Macintosh HD:yourpath:yourfile.qxd" use doc prefs yes
   export layout space 1 of project 1 in ("Macintosh HD:yourhotfolder:yourfile.ps") as "PDF"
end tell

The distiller settings don't have anything to do with this script. I didn't use the distiller for years. But if I remember correctly you define your hotfolder and the settings for the processed ps-files in Distiller. Just open the distiller and type cmd-F.

Good luck!

Offline nellbern

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #5 on: June 25, 2009, 08:27:10 AM »
tttexter,
Thank you for your quick response. I just want to understand & learn from people like you. When I check the pdf using your script they are preflighting OK in Acrobat.

Quote
The distiller settings don't have anything to do with this script. I didn't use the distiller for years. But if I remember correctly you define your hotfolder and the settings for the processed ps-files in Distiller.

Then, if distiller is not used for pdf creation how the pdf is created in your script? Is it using Quark Jaws pdf writer? How do you convert your script into a droplet where you just drag Quark files into it.

Offline tttexter

  • Visitor
  • Posts: 4
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #6 on: June 30, 2009, 02:41:22 AM »
Nell

Yes I use Quark 8 to create PDFs. And I'm happy with it. Don't have any problems since QXP 7.

How do you convert your script into a droplet where you just drag Quark files into it.

Save your script as an application. The script has to contain an on open handler like this:

on open droppedfile
   tell application "QuarkXPress"
     activate
     open droppedfile
     -- ...
   end tell
end open

Offline nellbern

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #7 on: June 30, 2009, 08:26:08 AM »
Thanks for your help. ;)

Offline nellbern

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #8 on: June 30, 2009, 10:50:50 AM »
tttexter,
I'm sorry to bother you again but why I'm getting a message file already exists.
on open droppedfile
   tell application "QuarkXPress"
      activate
      open droppedfile
      export layout space 1 of project 1 in ("Homes-2:nr:Desktop:untitled folder:") as "PDF" PDF output style "*RD .5 bleed"
end tell
end open

Offline tttexter

  • Visitor
  • Posts: 4
  • Karma: 0
Re: Q8 : Export to PDF Automation AppleScript - need code clue
« Reply #9 on: June 30, 2009, 11:31:56 AM »
No problem  :)

why I'm getting a message file already exists

Because with this script you do not export into an folder. You export into a file. You have to specify the path with the name of the file.

on open droppedfile
   tell application "QuarkXPress"
      activate
      open droppedfile
      set niceName to name of project 1 -- or: to name of layout space 1 of project 1
      export layout space 1 of project 1 in ("Homes-2:nr:Desktop:untitled folder:" & niceName & ".pdf") as "PDF" PDF output style "*RD .5 bleed"
end tell
end open

This will work too:

on open droppedfile
   tell application "QuarkXPress"
      activate
      open droppedfile
      export layout space 1 of project 1 in ("Homes-2:nr:Desktop:untitled folder:" & name of project 1  & ".pdf") as "PDF" PDF output style "*RD .5 bleed"
end tell
end open
« Last Edit: June 30, 2009, 11:51:22 AM by tttexter »