Frame bounds validate and write in report

Discuss AppleScripting for QuarkXPress 2015, 2016 & 2017.

Frame bounds validate and write in report

Postby selvam214d » 08 Dec 2017, 09:28

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,
Selva
selvam214d
 
Posts: 2
Joined: 08 Dec 2017, 09:14

Re: Frame bounds validate and write in report

Postby pjanssen » 13 Dec 2017, 04:59

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.
pjanssen
 
Posts: 132
Joined: 31 Dec 1969, 19:00

Re: Frame bounds validate and write in report

Postby selvam214d » 13 Dec 2017, 05:48

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 (http://macscripter.net/viewtopic.php?id=17036). We will in other system also and share our result ASAP.


Very useful for you reply.



Thanks,
Selva
selvam214d
 
Posts: 2
Joined: 08 Dec 2017, 09:14


Return to QuarkXPress 20xx: Scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron