in

Quark Forums

Convert inch value into mm value using AppleScript

Last post 11-13-2009 3:03 AM by larsen67. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-12-2009 9:03 PM

    • prabu
    • Top 150 Contributor
    • Joined on 06-04-2009
    • Chennai
    • Posts 64

    Convert inch value into mm value using AppleScript

     If i have variable with inch value, how can i convert into mm value?

    Regards
    Prabu
  • 11-13-2009 3:03 AM In reply to

    Re: Convert inch value into mm value using AppleScript

    This may NOT be the greatest of examples but here is some info on using measurement values in Quark.

     

    001    tell application "QuarkXPress"
    002         tell document 1
    003              -- My app default is Millimetre Units
    004              set a to width of bounds of current page
    005              -- Coerce to other Unit
    006              set b to (width of bounds of current page) as inch units
    007              -- Coerce to other Unit and remove unit identifier for math
    008              set c to ((width of bounds of current page) as inch units) as real
    009              -- Coerce values to common value for math
    010              set d to (("1\"" as point units) as real) + (("25.4 mm" as point units) as real)
    011              -- Set any number value to a measurement unit then convert
    012              set e to ((d as point units) as inch units)
    013         end tell
    014    end tell
    015    a -- returns "297 mm"
    016    b -- returns "11.693\""
    017    c -- returns 11.692916870117
    018    d -- returns 144.0
    019    e -- returns "2\"" 

     

     

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems