Hallo,
ich versuche verzweifelt ein Dokument in QuarkXPress 3 zu öffnen (via
AppleEvents).
Mit AppleScript geht das so:
-------------------------------
tell application "QuarkXPress™"
open "Festplatte:Testdoc" use doc prefs yes
end tell
-------------------------------
"Capture AE" zeigt dann folgendes an: Process("QuarkXPress™").SendAE
"aevt,odoc,'----':obj {form:name, want:type(file),
seld:“Festplatte:Testdoc”, from:'null'()}, KPRF:yes , &csig:magn
(«00010000»)"
-------------------------------
Wenn das Dokument "Testdoc" nicht existiert, dann erhalte ich eine
Fehlermeldung (nummer) -43, bzw. 32767.
So habe ich es im RB2006 versucht:
-------------------------------
Dim ae as AppleEvent
Dim o as AppleEventObjectSpecifier
ae = NewAppleEvent("aevt", "odoc", "XPR3")
o = GetNamedObjectDescriptor("file",Nil,"Festplatte:Testdoc")
ae.ObjectSpecifierParam("----") = o
ae.EnumeratedParam("KPRF") = "yes "
if not ae.Send then
MsgBox "Fehler beim senden von AE"
Return
end if
MsgBox ae.ReplyString
MsgBox str(ae.ReplyInteger)
-------------------------------
Capture AE sagt zu meinem Event: Process("QuarkXPress™").SendAE
"aevt,odoc,'----':obj {want:type(file), from:'null'(), form:name,
seld:“Festplatte:Testdoc”}, KPRF:yes "
-------------------------------
Leider ohne Erfolg, es kommt kein Reply !
Der Unterschied zu oben ist höchstens das "&csig:magn(....", wobei
ich nicht weiss was das ist und wie man es erzeugt (habe schon alle
Typen durchprobiert).
Laut AEDump hat Quark folgendes in der Standard-Suite:
-------------------------------
Suite "Standard Suite"
Common terms for most applications.
Suite ID : 'core' Level : 1 Version : 1
------------------------------------------------------------------------
--------
Event "open"
Open the specified object(s).
Class : 'aevt'
ID : 'odoc'
Reply : 'null'
Direct : 'obj '
List of objects to open.
"Required" "Single" "Not Enum." "State Change"
Additional Parameters
---------------------
Parameter "use doc prefs"
Specifies whether document preferences should be used (as
opposed to Application preferences).
Keyword : 'KPRF'
Type : 'KPRF'
"Optional" "Single" "Enum." "Named" "Not Fem." "Not Masc."
"Singular"
Parameter "remap fonts"
Specifies whether or not to remap any fonts which were used in
the document but which don’t exist in the current system.
Keyword : 'RMPF'
Type : 'RMPF'
"Optional" "Single" "Enum." "Named" "Not Fem." "Not Masc."
"Singular"
Parameter "do auto picture import"
Specifies whether or not to re-import any missing pictures.
Keyword : 'KAUP'
Type : 'KAUP'
"Optional" "Single" "Enum." "Named" "Not Fem." "Not Masc."
"Singular"
------------------------------------------------------------------------
--------
Der "Reply: 'null'" sagt meiner Meinung nach nur aus, das es kein
Ergebnis hat, also keine Werte angefragt werden. Die Fehler sollten
aber dennoch durchkommen (eigentlich vom MacType "errn" und "errs")
nur weiss ich nicht wie ich darauf zugreifen kann.
Das einzige was gesetzt ist, ist der ae.ReplyPtr, ein Zeiger auf
einen AppleEventRecord.
Hat jemand eine Idee wie ich an den Fehlercode komme ?
Mit freundlichen Grüssen,
Oliver Geisen
_____________________________
Systemadministrator
Kreisboten Verlag Mühlfellner KG
82362 Weilheim i. Ob.
Tel. 0881/686-904
Fax 0881/686-74