Re: Quark - Text File
Re: Quark - Text File
- Subject: Re: Quark - Text File
- From: Luca BASSINI <email@hidden>
- Date: Thu, 9 Dec 2004 13:18:07 +0100
Sophie,
nice to hear you again ;-)
Try this script, it uses some useful applescript's basic functions...
set folderSelect to choose folder -- choose destination folder
set docSelect to choose file -- choose a XPress doc to be opened
tell application "QuarkXPress Passport"
activate -- Activate Quark
open docSelect -- Open chosen file
tell document 1 -- Tell front document
repeat with iLoop from 1 to count of stories -- Loop through each
story
set textOfTheStory to text of story iLoop
set theTextFile to (folderSelect as text) & "xDocStories.txt"
my write_to_file(textOfTheStory, theTextFile) -- call the subroutine
end repeat
end tell
close document 1 saving no
end tell
on write_to_file(this_data, target_file)
try
set the target_file to the target_file as text
set the open_target_file to open for access file target_file with
write permission -- if not exists the file will be created
write this_data to the open_target_file starting at eof -- writes the
text of every single story
close access the open_target_file -- closing the file
return true
on error -- error handling: the file has to closed !!!
try
close access file target_file
end try
return false
end try
end write_to_file
Hope this could help
Luca
On 09/dic/04, at 13:04, Sophie Ford wrote:
I have the following code that works well converting each text box
into an individual text file.
Is it possible to instruct Quark to put each story into one complete
text file instead?
set folderSelect to choose folder -- choose destination folder
set docSelect to choose file -- choose a file
tell application "QuarkXPress"
activate -- Activate Quark
open docSelect -- Open chosen file
tell document 1 -- Tell front document
repeat with iLoop from 1 to count of stories -- Loop through each
story
save story iLoop in ((folderSelect as text) & iLoop as text) --
save each story counted in our loop to selected folder as text
end repeat
end tell
close document 1 saving no
end tell
Many thanks in advance! _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden