I need to read text from a Quark document:
“61145”
“61156”
“6122”
“611546”
I need to find the text in the Quark document that looks like the above and put it into an applescript list for further processing
{“61145”,“61156”,“6122”,“611546”}
Any suggestions?
tell application "QuarkXPress 4.1"
activate
if not (document 1 exists) then
make new document at beginning
end if
-- read all text in quark document
set quarktext to " "
repeat with i from 1 to (count of stories in document 1)
tell document 1
set quarkword to (text of story i)
set quarktext to quarktext & quarkword
end tell
end repeat
-- end read all text in quark document
end tell
set x to quarktext
set the_data to {}
repeat with this_row in (paragraphs of x)
set this_row to (contents of this_row)
if this_row contains "�" then set end of the_data to text ((offset of "�" in this_row) + 1) thru ((offset of "�" in this_row) - 1) of this_row
end repeat
return the_data