I have in Quark document which includes content like list “a”, “b”, “c”, “d”
Why /set ItemsList to {QurakItems}/
is not the same /set ItemsList to {“a”, “b”, “c”, “d”}/
How can I get list from Quark and put it to applescript?
See above example:
tell application "QuarkXPress Passport™ 4.11"
tell document 1
tell text box 1
tell story 1
set QurakItems to contents of it
end tell
end tell
end tell
end tell
set ItemsList to {QurakItems}
repeat with ItemFromList in ItemsList
tell application "Finder"
display dialog "item:" & ItemFromList
end tell
end repeat
You just need to coerce the text in story 1 to a list. You can do so by using text item delimiters.
tell application "QuarkXPress™"
--reduce the number of times you tell something
tell story 1 of text box 1 of document 1
--get the contents of the story
set QurakItems to contents of it
end tell
--capture the current text item delimiters
set oldDelims to AppleScript's text item delimiters
--temporarily set them to return
set AppleScript's text item delimiters to return
--get the return delimited text items of story 1
set itemsList to the text items of QurakItems
--reset the text item delimiters
set AppleScript's text item delimiters to oldDelims
repeat with ItemFromList in itemsList
--just have Quark display the dialog instead of invoking the Finder.
--up to you really, you can have the Finder do the dialog if you want
display dialog "item:" & ItemFromList
end repeat
end tell