Fischer-Bayern.de
 FAQFAQ   SuchenSuchen   MitgliederlisteMitgliederliste   BenutzergruppenBenutzergruppen   RegistrierenRegistrieren 
 ProfilProfil   Einloggen, um private Nachrichten zu lesenEinloggen, um private Nachrichten zu lesen   LoginLogin 

QuarkXpress Dokumente exportieren als PDF-Datei - Obige Funk

 
Dieses Forum ist gesperrt, du kannst keine Beiträge editieren, schreiben oder beantworten.   Dieses Thema ist gesperrt, du kannst keine Beiträge editieren oder beantworten.    Fischer-Bayern.de Foren-Übersicht -> AppleScript-Forum
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
strego
•->
•->


Anmeldedatum: 04.06.2002
Beiträge: 1

BeitragVerfasst am: 04.06.2002 - 13:32    Titel: QuarkXpress Dokumente exportieren als PDF-Datei - Obige Funk Antworten mit Zitat

Frage?
Ist es möglich QuarkXpress Dokumente in einen Ordner abzulegen.
Dann wird eine Aktion gestartet also die Datei geöffnet und als pdf-Datei in einem neuen Ordner abgespeichert.
Das ganze soll unter MAC OS 9 laufen.
Danke
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden E-Mail senden
Daisy
•-->
•-->


Anmeldedatum: 26.04.2002
Beiträge: 79

BeitragVerfasst am: 04.06.2002 - 21:58    Titel: QuarkXpress Dokumente exportieren als PDF-Datei Antworten mit Zitat

Hallo Strego,

das sollte möglich sein, wenn auch nicht ganz einfach

Zwei Wege könnte ich mir da vorstellen (ich gehe davon aus, dass Dir das Ergebnis des "Acrobat Writer" nicht ausreicht):
1. aus dem Quark in ein Postscriptfile drucken, dann hast Du nur eine Datei und es wird im Acrobat einfacher - der Nachteil ist aber, dass das Erzeugen des Postscriptfiles nicht so einfach ist. Ich habe zu dem Thema (Drucker auswählen, Druckerdialoge etc) hier glaube ich schon ein paar Threads gesehen - probier's mal mit "Suche".

2. Mit der Funktion "Seite als EPS sichern" - das läßt sich komfortabel aus Quark scripten - allerdings hast du dann lauter einzelne EPSe und etwas mehr Arbeit in Acrobat. Zum ersten Teil gibt es von Quark ein Beispielscript ( "Save all pages as eps" ) das du Dir mal anschauen kannst - es ist m.E. auf der 5er CD drauf, läuft aber auch mit 4. Falls Du die CD nicht hast und es auf den Seiten von Quark nicht findest, kann ich es Dir gerne schicken oder hier posten (muss mal schauen, wie das rechtlich aussieht).

Zum Acrobat-Part bin ich sicher, schon einige fertige Lösungen im Web gesehen zu haben - such einfach mal auf den bekannten Scripter-Seiten.

Zu den beiden Lösungsmöglichkeiten: ich würde den zweiten Weg bevorzugen, da es ohne "Tricks" auskommt und Du die Möglichkeit hast, wenn ein Postscript-Fehler auftritt, wenigstens die restlichen Seiten destilliert zu bekommen.

Gruss

Daisy

(Geändert von Daisy um 22:01 Uhr am 4 Juni 2002)
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Daisy
•-->
•-->


Anmeldedatum: 26.04.2002
Beiträge: 79

BeitragVerfasst am: 05.06.2002 - 07:34    Titel: QuarkXpress Dokumente exportieren als PDF-Datei Antworten mit Zitat

Hallo Strego,

hier das angekündigte Beispiel von Quark:

Each Page as EPS...
This script will save each page of your document as an individual EPS file.
Steps
1. Run this script.
2. Choose a document on which this script will operate.
3. Choose a folder in which to save the EPS files.
4. If a file exists with the same name as a file being save, you will be prompted to specify how you want filename conflicts handled.
Note: This script will save the EPS files at 100% size with a Color TIF preview and with transparent page white.
-----------------------------------------------
(*
Copyright © 1994-2001 - All Rights Reserved
Quark, Inc.
http://www.Quark.com

Copying and sharing of this script in whole or in part is allowed. The authors are
not responsible for any losses caused by the use of or failure of this software.
*)

tell application "QuarkXPress Passportô 5"
activate

try
-- This section will allow the user to specify which document to use, either the active document or browse to a document
if (exists document 1) and doc format of document 1 is in {"XDOC", "XTMP"} then
set whatDoc to button returned of (display dialog "Would you like to use the Active document or choose a new document?" buttons {"Cancel", "Choose", "Active"} default button "Active" )
if whatDoc is "Choose" then
set File_Location to ((choose file of type {"XDOC", "XTMP"} with prompt "\"Select a QuarkXPress document.\"" ) as text)
try
open alias File_Location use doc prefs yes remap fonts no do auto picture import no
end try
end if
if whatDoc is "Cancel" then error "User canceled." number -128
else
set File_Location to ((choose file of type {"XDOC", "XTMP"} with prompt "\"Select a QuarkXPress document.\"" ) as text)
try
open alias File_Location use doc prefs yes remap fonts no do auto picture import no
end try
end if

-- This line allows the user to specify a folder into which the EPS files will be saved
set DestFolder to (choose folder with prompt "Select a folder in which to the save the EPS files." ) as text

-- This section will parse the document name, to use when saving the EPS files
tell document 1
set DocName to name as text
set olddelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to "."
if text item -1 of DocName = "qxd" then
try
set DocName to text items 1 thru -2 of DocName
set AppleScript's text item delimiters to olddelims
on error errmsg
set AppleScript's text item delimiters to olddelims
log errmsg
end try
end if

-- This section will cycle through the pages and save each as an EPS
try
set overwrite to null
set curPage to page number of current page
set pageCnt to count of pages
repeat with i from 1 to count of pages
-- This section will create the sequential number for the file
set fileNum to ""
repeat until (length of (fileNum as text)) = (length of (pageCnt as text))
if fileNum = "" then
set fileNum to i
else
set fileNum to "0" & fileNum
end if
end repeat

-- This line will create the name for the file
set FilePath to DestFolder & DocName & "_" & fileNum & ".eps"

-- This following line will invoke a dialog for the first file whose name already exists
-- This selection will be applied to subsequent files, so the dialog won't be display again
set overwrite to my ifFileExists(FilePath, overwrite)

-- The following section performs the save, if appropriate
if overwrite is true or overwrite is null or overwrite is "temp" then
save page i in FilePath EPS format PC color EPS data binary EPS scale 100 with transparent page
else if overwrite is "Quit" then
-- The user cancelled from the duplicate file notification dialog
-- This will end the script
error "User canceled" number -128
end if
end repeat

-- The following beep will provide feedback of script completion
beep 2
on error errmsg number errnum
error errmsg number errnum
end try
end tell
on error errmsg number errnum
if errnum is -108 then
beep
display dialog errmsg & return & return & ¨
"Try allocating more memory to " & name & "." buttons {"OK"} default button 1 with icon stop
return
else if errnum is not -128 then
beep
display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
end if
return
end try
end tell

--=================================== Handlers =========================================
-- Below is the handler (subroutine) that is called from the above script
--===================================================================================

on ifFileExists(FilePath, bOverWrite)
if bOverWrite is null then
-- This section will check to see if a file exists, until a matching name has been found
tell application "Finder"
if exists alias FilePath then
tell application "QuarkXPress Passportô 5"
set overwrite to button returned of (display dialog "A file(s) with the same name already exists at this location. Saving will delete the existing file(s)." & return & return & ¨
"Do you want to save anyway?" buttons {"Cancel", "Don't Save", "Save"} default button "Save" with icon caution)
end tell
if overwrite is "Save" then
return true
else if overwrite is "Don't Save" then
return false
else if overwrite is "Cancel" then
return "Quit"
end if
else
return null
end if
end tell
else if bOverWrite is true then
-- This section will keep creating files regardless of whether the names already exist
return true
else if bOverWrite is false or bOverWrite is "temp" then
try
tell application "Finder"
if exists alias FilePath then
-- This line will ensure that files whose names already exist are not created,
-- if you user previous chose to skip such file
return false
else
-- This line will ensure that files whose names don't already exist will be created,
-- if the user previously chose to not overwrite existing files
return "temp"
end if
end tell
on error errmsg number errnum
beep
display dialog errmsg & " [" & errnum & "]" buttons {"Cancel"} default button 1 with icon stop
return
end try
end if
end ifFileExists
---------------------------------------------------------------------

und es kommt noch besser - es gibt noch ein zweites Skript das "Each Page as PS or PDF..." heisst" - das habe ich allerdings noch nicht mit Quark 4 ausprobiert:

...Each Page as PS or PDF...
This script will save each page of your document as individual PostScript and/or PDF file.
Steps
1. Run this script.
2. Choose a document on which this script will operate.
3. Choose to create both PostScript and PDF files or PostScript files only.
4. Choose a folder in which to save the PostScript and/or PDF files.
5. If a file exists with the same name as a file being save, you will be prompted to specify how you want filename conflicts handled.
Note
To specify the Print settings, modify the Print dialog and choose Capture Settings, before running this script.
Requirements
This script requires that you have Acrobat Distiller installed, in order to create the PDF files

-----------------------------------------------------
(*
Copyright © 2001 - All Rights Reserved
Quark, Inc.
http://www.Quark.com

Copying and sharing of this script in whole or in part is allowed. The authors are
not responsible for any losses caused by the use of or failure of this software.
*)

tell application "QuarkXPress Passportô 5"
activate

try
display dialog "To specify the print settings, modify the Print dialog and choose Capture Settings, before running this script." buttons {"Cancel", "Continue"} default button "Continue" with icon note
if button returned of result is "Cancel" then error "User canceled." number -128

-- This section will allow the user to specify which document to use, either the active document or browse to a document
if (exists document 1) and ´class OSTYª of document 1 is in {"XDOC", "XTMP"} then
set whatDoc to button returned of (display dialog ¨
"Would you like to use the Active document or choose a new document?" buttons {"Cancel", "Choose", "Active"} default button "Active" )
if whatDoc is "Choose" then
set File_Location to ((choose file of type {"XDOC", "XTMP"} with prompt "\"Select a QuarkXPress document.\"" ) as text)
try
open alias File_Location given ´class KPRFª:yes, ´class RMPFª:no, ´class KAUPª:no
end try
end if
if whatDoc is "Cancel" then error "User canceled." number -128
else
set File_Location to ((choose file of type {"XDOC", "XTMP"} with prompt "\"Select a QuarkXPress document.\"" ) as text)
try
open alias File_Location given ´class KPRFª:yes, ´class RMPFª:no, ´class KAUPª:no
end try
end if

set PSorPDF to button returned of (display dialog ¨
"Do you want to distill the PostScript files into PDF files?" buttons {"Cancel", "PostScript and PDF", "PostScript only"} default button "Postscript only" )
if PSorPDF is "Cancel" then error "User canceled." number -128

-- This line allows the user to specify a folder into which the PostScript and/or PDF files will be saved
set DestFolder to (choose folder with prompt "Select a folder in which to the save the files." ) as text

tell document 1
-- This section will parse the document name, to use when saving the PostScript files
set DocName to my GetDocName(name)

-- This script will error if a blank page is not printed
tell ´class PTSUª
set BlankPages to ´class INCBª
set ´class INCBª to true
end tell

-- This section will cycle through each page and save it as an individual PostScript file
try
set overwrite to null
set curPage to ´class PGNMª of ´class CUPGª
set pageCnt to count of every ´class pageª
repeat with i from 1 to count of every ´class pageª
tell ´class pageª i
-- This section will create the sequential number for the file
set fileNum to ""
repeat until (length of (fileNum as text)) = (length of (pageCnt as text))
if fileNum = "" then
set fileNum to i
else
set fileNum to "0" & fileNum
end if
end repeat

-- This line will create the name for the file
set FilePath to DestFolder & DocName & "_" & fileNum & ".ps"

-- This following line will invoke a dialog for the first file whose name already exists
-- This selection will be applied to subsequent files, so the dialog won't be display again
set overwrite to my ifFileExists(FilePath, overwrite)

-- The following section performs the save, if appropriate
if overwrite is true or overwrite is null or overwrite is "temp" then
if overwrite is true then
-- This section will delete PS existing files with matching names
try
tell application "Finder" to delete alias FilePath
end try
end if
print given ´class PSFLª:FilePath
if PSorPDF is "PostScript and PDF" then my DistillFile(FilePath)
else if overwrite is "Quit" then
-- The user cancelled from the duplicate file notification dialog
-- This will end the script
error "User canceled" number -128
end if
end tell
end repeat

-- This line will show the page that was originally selected
set ´class CUPGª to ´class pageª curPage

-- This will return the include blank pages property to its original state
tell ´class PTSUª
set ´class INCBª to BlankPages
end tell

-- The following beep will provide feedback of script completion
beep 2
on error errmsg number errnum
-- This will return the include blank pages property to its original state
tell ´class PTSUª
set ´class INCBª to BlankPages
end tell
error errmsg number errnum
end try
end tell
on error errmsg number errnum
if errnum != -128 then
beep
display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
end if
-- For compatibility with non-US English operating systems
return
end try
end tell

--=================================== Handlers =========================================
-- Below are the handlers (subroutines) that are called from the above script
--===================================================================================

-- This handler will get the name of the QuarkXPress document, minus any qxd file extension
on GetDocName(DocName)
set olddelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to "."
if text item -1 of DocName = "qxd" then
try
set DocName to text items 1 thru -2 of DocName
set AppleScript's text item delimiters to olddelims
on error errmsg
set AppleScript's text item delimiters to olddelims
log errmsg
return
end try
end if
log DocName
return DocName
end GetDocName

on ifFileExists(FilePath, bOverWrite)
if bOverWrite is null then
-- This section will check to see if a file exists, until a matching name has been found
tell application "Finder"
if exists alias FilePath then
tell application "QuarkXPress Passportô 5"
set overwrite to button returned of (display dialog "A file(s) with the same name already exists at this location. Saving will delete the existing file(s)." & return & return & ¨
"Do you want to save anyway?" buttons {"Cancel", "Don't Save", "Save"} default button "Save" with icon caution)
end tell
if overwrite is "Save" then
return true
else if overwrite is "Don't Save" then
return false
else if overwrite is "Cancel" then
return "Quit"
end if
else
return null
end if
end tell
else if bOverWrite is true then
-- This section will keep creating files regardless of whether the names already exist
return true
else if bOverWrite is false or bOverWrite is "temp" then
try
tell application "Finder"
if exists alias FilePath then
-- This line will ensure that files whose names already exist are not created,
-- if you user previous chose to skip such file
return false
else
-- This line will ensure that files whose names don't already exist will be created,
-- if the user previously chose to not overwrite existing files
return "temp"
end if
end tell
on error errmsg number errnum
if errnum is not -128 then
beep
display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
end if
return
end try
end if
end ifFileExists

(*This section will distill the PostScript file*)
on DistillFile(FilePath)
tell application "QuarkXPress Passportô 4.1"
my FileExists(FilePath)
open alias FilePath
end tell
end DistillFile

(*** This will create a delay to give the files time to save ***)
on FileExists(FilePath)
tell application "Finder"
set go to false
repeat until go is true
if exists alias FilePath then set go to true
end repeat
end tell
end FileExists
-----------------------------------------------------------------

Wie immer macht das Board natürlich einige Zeilenumbrüche in das Skript, die du leider wieder entfernen musst, damit's läuft ....
Das war's - fröhliches Basteln :-)

(Ich hoffe, Snow ist nicht böse wegen des umfangreichen Posts ... )

Gruß


Daisy




(Geändert von Daisy um 7:37 Uhr am 5 Juni 2002)
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Beiträge der letzten Zeit anzeigen:   
Dieses Forum ist gesperrt, du kannst keine Beiträge editieren, schreiben oder beantworten.   Dieses Thema ist gesperrt, du kannst keine Beiträge editieren oder beantworten.    Fischer-Bayern.de Foren-Übersicht -> AppleScript-Forum Alle Zeiten sind GMT + 2 Stunden
Seite 1 von 1

 
Gehe zu:  
Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.


Powered by phpBB © 2001, 2002 phpBB Group
Deutsche Übersetzung von phpBB.de


AppleScript für absolute Starter