Page 1 of 1

Frame bounds validate and write in report

Posted: 08 Dec 2017, 09:28
by selvam214d
Hi All,
I'm new in this forum, I need to write a script with below steps. Kindly help on this topic to step up next level.

1. Start current document
2. Change basic measures
3. Collect the bounds from every text frames
4. Check round value and half of the round value (2 or 2.5 not in 2.35)
5. If not round value then write in text file

I have stuck in get the value with string not write the value in effectively, please see the attachment.

Code: Select all

tell application "QuarkXPress"
	tell document 1
		set filePath to (file path as string)
		set txf to filePath & "_log.txt"
		set myFile to open for access txf with write permission
		set page rule origin to {"0", "0"}
		set horizontal measure to millimeters
		set vertical measure to millimeters
		set myfr to every text box
		repeat with mytf in myfr
			set myY to top of bounds of mytf
			set myX to left of bounds of mytf
			write myX to myFile starting at eof
			write myY to myFile starting at eof
		end repeat
	end tell
	close access myFile
end tell
Kindly help to modify this code or let me know if any another method.

Thanks in advance,

Re: Frame bounds validate and write in report

Posted: 13 Dec 2017, 04:59
by pjanssen
Well, I tried the script and it worked without problems for me. E.g. this was written in a test file:

88 mm145,344 mm66 mm69,497 mm41,628 mm40,569 mm

So difficult to say what went wrong at your side. Maybe you should look into a program like "Script Debugger", if you want to write complex scripts. It helps a lot with debugging.

Re: Frame bounds validate and write in report

Posted: 13 Dec 2017, 05:48
by selvam214d
Hi pjanssen,
Thanks for the analysis. After long testing, we concluded to the quark value not return out of from application. May be the application not installed properly. The same in applescript forum also ( We will in other system also and share our result ASAP.

Very useful for you reply.