Thursday, October 23, 2014

#1 2012-11-28 03:09:14 pm

GoingPostal
Member
Registered: 2012-02-21
Posts: 15

Script to ask questions before printing in indesign

I have been asked if their is a script i could use that will:

When i am ready to print i run the script. It will ask me if i have checked borders, fonts, etc and if i click yes it will continue to the print dialog. If i click no it will stop and let me make the changes.

Any ideas?


Filed under: Indesign, applescript

Offline

 

#2 2012-11-28 05:00:11 pm

Budgie
Member
From: New Zealand
Registered: 2005-02-22
Posts: 544

Re: Script to ask questions before printing in indesign

could you use a print preset instead of going through the print dialog?


Budgie

"Only two things are certain: the universe and human stupidity; and I'm not certain about the universe."
-- Albert Einstein (1879-1955)

Offline

 

#3 2012-11-28 05:12:08 pm

GoingPostal
Member
Registered: 2012-02-21
Posts: 15

Re: Script to ask questions before printing in indesign

I tried that but with no luck, its mainly to remind the user to check their work before printing

Offline

 

#4 2012-11-28 05:14:53 pm

kerflooey
Member
Registered: 2011-07-07
Posts: 62

Re: Script to ask questions before printing in indesign

I think using a Print Preset is best. You simply refer to it in a script by its name. If I know I will need to customize anything, I just select it from the Print Presets menu and fill things in manually.

Last edited by kerflooey (2012-11-28 05:16:47 pm)

Offline

 

#5 2012-11-28 05:59:01 pm

Budgie
Member
From: New Zealand
Registered: 2005-02-22
Posts: 544

Re: Script to ask questions before printing in indesign

simply you could use this:

Applescript:

tell application "Adobe InDesign CS6"
   activate
   set MakeYourChoice to display dialog "Have you checked borders etc etc" buttons {"No", "Yes"}
   if button returned of MakeYourChoice is "Yes" then
       print active document with print dialog
   else
       display dialog "You got some work to do then" giving up after 2
   end if
end tell

or something like this, which we can adjust to turn of specific colours, goto a specific hot folder etc etc
this gives you a lot of flexibility

Applescript:

tell application "Adobe InDesign CS6"
   activate
   set MakeYourChoice to display dialog "Have you checked borders etc etc" buttons {"No", "Yes"}
   if button returned of MakeYourChoice is "Yes" then
       -----
       tell application "Adobe InDesign CS6"
           set PathToDesktop to "HotFolders:H:" as string --PATH TO HOT FOLDER
           tell application "Adobe InDesign CS6"
               activate
               tell active document
                   set horizontal measurement units of view preferences to millimeters
                   set vertical measurement units of view preferences to millimeters
                   tell document preferences
                       set pw to the page width
                       set ph to the page height
                       set document slug uniform size to true
                       set slug top offset to 0
                   end tell
                   
                   set myName to (name of it) as string
                   set AppleScript's text item delimiters to {"."}
                   set fileBase to first text item of (myName as string)
                   set AppleScript's text item delimiters to {""}
                   set PS_file_path to (PathToDesktop & fileBase & ".ps") as string
                   
                   tell print preferences
                       set printer to postscript file
                       set PPD to "Cobra 2-up" --PPD
                       set print file to PS_file_path
                       set color output to inRIP separations
                       set trapping to off
                       try
                           set bleed chain to true
                           set bleed top to 0
                       end try
                       set use document bleed to print to false
                       set include slug to print to false
                       set all printer marks to false
                       set tile to false
                       set page position to centered
                       set print page orientation to portrait
                       set paper size to custom
                       set paper height to ph
                       set paper width to pw
                       set download PPD fonts to true
                       set screening to "150 lpi/2540 dpi" -- LPI & DPI
                       set flip to none
                       set font downloading to complete
                       set OPI image replacement to false
                       set print layers to visible printable layers
                       set print nonprinting to false
                       set print spreads to false
                       set scale mode to scale width height
                       set scale height to 100
                       set scale width to 100
                       set scale proportional to true
                       set send image data to optimized subsampling
                       set sequence to all
                   end tell
               end tell
           end tell
           ---------
           tell application "Adobe InDesign CS6" --Prints only cmyk sperations
               set theDoc to active document
               set allowtoprint to {"Process Cyan", "Process Magenta", "Process Yellow", "Process Black"} as string
               set print ink of every ink of theDoc whose name is not in allowtoprint to false
           end tell
           ---------
           display dialog ("Printing Separation") buttons "Printing" giving up after 1
           with timeout of 1800 seconds
               print active document without print dialog
           end timeout
           --close active document saving yes --uncomment if you want you file to close and save
       end tell
       -----
   else
       display dialog "You got some work to do then" giving up after 2
   end if
end tell

Last edited by Budgie (2012-11-28 06:00:01 pm)


Budgie

"Only two things are certain: the universe and human stupidity; and I'm not certain about the universe."
-- Albert Einstein (1879-1955)

Offline

 

#6 2012-11-28 08:04:41 pm

GoingPostal
Member
Registered: 2012-02-21
Posts: 15

Re: Script to ask questions before printing in indesign

Thats perfect, thank you very much!

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.145 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)