[Pythonmac-SIG] Quark Xpress - setting import styles to true (Xtags)
Advertising Department
advertising at robbstucky.net
Thu Nov 13 22:59:17 CET 2008
Hello all,
Am trying to import an xtags file into a QuarkXpress document using
appscript.
I'm using the same xtags file for both examples.
When using AppleScript, the file is imported and the styles are applied.
Unfortunately, using appscript the tags are ignored and come in as
plain text.
My appleScript file... works correctly
------------------------------------------------------------------------
--
set thepath to (path to desktop folder from user domain) as string
set thefile to thepath & "sample.xtg"
tell application "QuarkXPress"
set import styles to true
activate
tell document 1
set every text of text box "projectbox" to file thefile
end tell
end tell
my appScript file... does not work
------------------------------------------------------------------------
--
#!/Library/Frameworks/Python.framework/Versions/Current/bin/pythonw
from appscript import *
input = open("output.xtg", "rU")
thetext = input.read()
qxp = app(u'/Applications/QuarkXPress 6.1/QuarkXPress')
qxp.activate()
qxp.properties.set({k.import_styles: True})
#app(u'QuarkXPress').import_styles.set(True)
qxp.documents[1].pages[-1].text_boxes['projectbox'].text.set(thetext)
This appears to be a valid translation of the working applescript,
but it doesn't seem to turn on the import_styles.
I've tried various incantations of the properties.set and
app.import_styles lines.
Quark neither complains nor complies.
Anyone have any clues as to why Quark is ignoring the import styles
from appscript?
Thanks
More information about the Pythonmac-SIG
mailing list