Find whether the last word in each page in quark is a hyphenated word.

Hi All,

I develop one applescript to find whether the last word in each page is hyphenated word or not. I am able to find the last word in each page. But I find it difficult to decide whether the selected word is a hyphenated word or not.

My script is:


tell application "QuarkXPress"
	activate
	tell document 1
		set cc to count of page
		display dialog cc as string
		repeat with i from 1 to cc
			tell page i
				tell text box 1
					set last_word to last word
					
-----------------------
					-- Here I want to find whether the last_word is a hyphenated word or not
					
----------------------
				end tell
			end tell
		end repeat
	end tell
end tell

Could any one help on this.

Thanks,
Gopal

I don’t have Quark, but this works in Text Edit:

tell application "TextEdit"
	activate
	set cc to text of document 1
	set tid to AppleScript's text item delimiters
	set AppleScript's text item delimiters to " "
	set Lastword to text item -1 of cc
	set hyph to offset of "-" in Lastword
end tell
if hyph > 0 then
	tell me to activate
	display dialog Lastword & " is hyphenated."
end if
set AppleScript's text item delimiters to tid