Konvertierung von Quark 6 über Quark 5 zu Quark 4

E

EllyRigby

Aktives Mitglied
Thread Starter
Dabei seit
20.05.2005
Beiträge
403
Reaktionspunkte
1
Ich habe ein Script gefunden, mit dem man Quark 6- als Quark 4-Dateien abspeichern kann. Allerdings haben wir
a) keinen Rechner mit Quark 6 und Quark 5 und
b) bedeutend mehr Quark 5- als Quark 6-Dateien.
Deshalb wäre es von Vorteil, das Script in zwei Teile aufzuteilen (Q6->Q5, Q5->Q4). Wir haben es versucht: die Dokumente werden aufgerufen, aber nicht abgespeichert - offensichtlich haben wir einen Fehler im Script, den wir aber nicht finden (lauter Anfänger, was AppleScript angelangt). Fehlermeldung: Can’t get name of alias "Mac_11:Desktop Folder:Endseiten_Test:"

Hier ist das Originalscript (Quelle: http://www.quark.com/service/forums/viewtopic.php?t=662&sid=8ca57856b7ea1b84958b6f16708e97ce):

Code:
-- The path to the QuarkXPress 6 application
property QXP6 : "Macintosh HD:Applications:QuarkXPress 6.1:QuarkXPress"

-- The path to the QuarkXPress 5 application
property QXP5 : "Macintosh HD:Applications (Mac OS 9):QuarkXPress:QuarkXPress™"

global saveName5
global saveName4
global origName

on open theseFiles
repeat with i from 1 to the count of theseFiles
set thisFile to item i of theseFiles
using terms from application "Macintosh HD:Applications:QuarkXPress 6.1:QuarkXPress:"
tell application QXP6
(* The parameters to the open event prevent most of the possible dialogs
that can occur on opening a document from stopping the script *)
open thisFile use doc prefs yes remap fonts no do auto picture import no without reflow
(*if ((count of layout spaces of project 1) > 1) then
error "Too many layouts" number 900 -- can't handle multiple layouts
end if*)
set origName to name of project 1 -- save the original name for generating the downsaved names
set saveName5 to (path to desktop) & origName & "_5" as text -- create name for 5.x document
--set saveFile5 to (file saveName5) as file specification -- QuarkXPress is happiest using file specs
--display dialog saveName5
save document 1 in saveName5 version vers 50 -- downsave to 5.x format
close document 1 without saving -- "without saving" avoids the confirmation dialog
set saveName5 to saveName5 as alias
end tell

tell application QXP5
activate --needed to keep some font messages from stopping the script
--display dialog saveName5
open saveName5 use doc prefs yes remap fonts no do auto picture import no without reflow
set saveName4 to (path to desktop) & origName & "_4" as text
save document 1 in saveName4 version vers 40
close document 1 without saving
set saveName4 to saveName4 as alias
end tell
end using terms from

tell application "Finder"
activate
set theDelete to button returned of (display dialog "Delete the QXP 5 file?" default button 1)
if theDelete = "OK" then delete saveName5
end tell
end repeat
end open
 
...

Hallo EllyRigby,

du hättest eure Versuche auch posten sollen.

Code:
-- The path to the QuarkXPress 6 application 
property QXP6 : "Macintosh HD:Applications:QuarkXPress 6.1:QuarkXPress" 

global saveName5 

global origName 

on open theseFiles 
repeat with i from 1 to the count of theseFiles 
set thisFile to item i of theseFiles 
using terms from application "Macintosh HD:Applications:QuarkXPress 6.1:QuarkXPress:" 
tell application QXP6 
(* The parameters to the open event prevent most of the possible dialogs 
that can occur on opening a document from stopping the script *) 
open thisFile use doc prefs yes remap fonts no do auto picture import no without reflow 
(*if ((count of layout spaces of project 1) > 1) then 
error "Too many layouts" number 900 -- can't handle multiple layouts 
end if*) 
set origName to name of project 1 -- save the original name for generating the downsaved names 
set saveName5 to (path to desktop) & origName & "_5" as text -- create name for 5.x document 
--set saveFile5 to (file saveName5) as file specification -- QuarkXPress is happiest using file specs 
--display dialog saveName5 
save document 1 in saveName5 version vers 50 -- downsave to 5.x format 
close document 1 without saving -- "without saving" avoids the confirmation dialog 
set saveName5 to saveName5 as alias 
end tell 
end using terms from 
end repeat 
end open

Das müsste Script 1 sein. Ist ein Droplet. Also als Programm Speichern. Die Dateien einfach auf das Icon des Droplet ziehen. Der Pfad zu QuarkXPress muss natürlich stimmen. Gegebenenfalls das "Macintosh HD" in den Namen eurer Festplatte ändern.

Code:
-- The path to the QuarkXPress 5 application 
property QXP5 : "Macintosh HD:Applications (Mac OS 9):QuarkXPress:QuarkXPress™" 

global saveName4 
global origName 

on open theseFiles 
repeat with i from 1 to the count of theseFiles 
set thisFile to item i of theseFiles 
using terms from application "Macintosh HD:Applications (Mac OS 9):QuarkXPress:QuarkXPress™" 
tell application QXP5 
activate --needed to keep some font messages from stopping the script 
--display dialog saveName5 
open thisFile use doc prefs yes remap fonts no do auto picture import no without reflow 
set saveName4 to (path to desktop) & origName & "_4" as text 
save document 1 in saveName4 version vers 40 
close document 1 without saving 
set saveName4 to saveName4 as alias 
end tell 
end using terms from
(*
tell application "Finder" 
activate 
set theDelete to button returned of (display dialog "Delete the QXP 5 file?" default button 1) 
if theDelete = "OK" then delete thisFile
end tell 
*) 
end repeat 
end open

Das müsste das zweite Script sein, auch als Droplet. Das Löschen des QXP5 Files habe ich mal vorsichtshalber auskommentiert.
Keine Gewähr auf Funktionalität ;)

Gruß Andi

Edit: Variable origName war nicht definiert
 
Zuletzt bearbeitet:
Andi schrieb:
du hättest eure Versuche auch posten sollen.
Danke für deine Hilfe. Wir haben viele Versuche gemacht, das wäre ein extrem langer Post geworden. ;)

Andi schrieb:
Das müsste das zweite Script sein, auch als Droplet. Keine Gewähr auf Funktionalität ;)
Das erste Script habe ich noch nicht ausprobiert (im Moment kein Bedarf, aber das kommt noch), beim zweiten Script bekomme ich die Fehlermeldung
The variable origName is not defined.
in der Zeile
set saveName4 to (path to desktop) & origName & "_4" as text
 
...

Hallo EllyRigby,

ja das kann gut sein :rolleyes: Ich haben den Fehler schon bemerkt.
Ich ändere gleich das Script 2

Gruß Andi
 
Falls noch jemand Interesse hat, hier ist nun ein Script, das funktioniert (Quelle: http://www.quark.com/service/forums/viewtopic.php?t=662&start=15):

-- The path to the QuarkXPress 5 application
property QXP5 : "Mac_5:Applications (Mac OS 9):QuarkXPress Passport:QuarkXPress Passport™"

global saveName4
global origName

on open theseFiles
repeat with i from 1 to the count of theseFiles
set thisFile to item i of theseFiles
using terms from application "Mac_5:Applications (Mac OS 9):QuarkXPress Passport:QuarkXPress Passport™"
tell application QXP5
activate --needed to keep some font messages from stopping the script
--display dialog saveName5
open thisFile use doc prefs yes remap fonts no do auto picture import no without reflow

-- Option A
set origName to name of document 1

set saveName4 to (path to desktop) & origName & "_4" as text
save document 1 in saveName4 version vers 40
close document 1 without saving
set saveName4 to saveName4 as alias
end tell
end using terms from
end repeat
end open

on GetName(thisAlias)
tell application "Finder"
return name of thisAlias
end tell
end GetName

on GetTextItem(ThisString, ThisDelim, ThisItem)
-- ThisString -> String to look in
-- ThisDelim -> Text element that delimit the string
-- ThisItem -> Number of the element to return
copy the text item delimiters to OldDelims
set the text item delimiters to ThisDelim
if class of ThisItem is list then
set fromItem to (item 1 of ThisItem) as integer
set toitem to (item 2 of ThisItem) as integer
set arrItem to (text items fromItem thru toitem of ThisString)
else
set arrItem to every text item of ThisString
end if
set the text item delimiters to OldDelims


if class of ThisItem is list then
return arrItem as text
else
if ThisItem ? 0 then
return (item ThisItem of arrItem) as text
else
return arrItem as text -- return every items
end if
end if
end GetTextItem

Edit: Das Fragezeichen muss im letzten Absatz muss gegen ein Ungleichheitszeichen (alt+0) ausgetauscht werden, aber das wird hier im Forum nicht dargestellt.
 
Zuletzt bearbeitet:
...

Hallo EllyRigby,

ich hab noch Interesse.
Ich frag mich grad, was der Teil ab
on GetName(thisAlias)
macht. Der erste Teil sieht ja so aus wie mein Versuch, nachdem ich die origName noch eingefügt habe (war spät). Und im Ersten Script war dieser Teil anscheinend auch nicht nötig. Darum frage ich mich grad, wie das Ergebnis nach meinem Scriptversuch aussieht? Ich habe nämlich kein Quark und kann es daher nicht probieren :rolleyes:

Gruß Andi
 
Hallo Andi,

ich habe keine Ahnung, bin einfach nur froh, dass es jetzt funktioniert. Vielleicht kann dir jemand im Quark-Forum (siehe Link) oder aber einer der Apple-Script-Profis hier weiterhelfen.

EllyRigby
 
Zurück
Oben Unten