I really need help! I have to automate the process of saving text as a word document. When I export the document manually, it works fine. But when I use Applescript, this message appear : “Some data was the wrong type” There’s just text in the document. here’s a liht version of my script:
tell application “QuarkXPress™ 4.11”
activate
open file “Mac HD:Travail:Document2”
(* error at this line *)
save text of story 1 of document 1 in “Mac HD:Travail:Test_15.doc” as “WDBN”
end tell
I am relatively new to applescript. Maybe I don’t have the right syntax. I search on this forum for a solution but I found nothing…Maybe there’s a different way to export in word document (without any add-on XTension). I can export in simple text document but not in word document.
Hi… 
After the excellent script of Shane Stanley (thanks Mytzlscript), here a very small code (tested with QXP 3.32 and MacOs 9):
tell application "QuarkXPress™ 3.32"
tell document 1
set {DocPath, DocName} to {file path, name}
set Txt to (text of (every story of (every text box of (every page)))) as text
end tell
end tell
tell application "Finder"
set DocTxt to make file at (container of DocPath) ¬
with properties {name:DocName & ".txt", file type:"TEXT"}
write Txt to DocTxt
end tell
… 
The problem is I want formated text so in word ducument its ok but not in text document.
But Î think my problem is just the name of the XTension.
I wrote “WDBN” but I think it’s something like “W6BN” or “W8BN”
Thank you for helping me! 
Hi 
I seem that it is not possible to export formatted text from a QXP document with AppleScript, whatever the type of the final exported file (perhaps by using the XPress Tags). :rolleyes: