Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script to generate a UI box to resize a font in text selection

Return to Member Forum

  • Author
    Posts
    • #61985

      Hi,

      I would like to do a simple script to generate a user interface to control some details of font.

      I know this script is not necessary but I would like to know how to do it.

      Thank's in advance

      Sami

    • #62000
      mac grunt
      Member

      G'day

      These are the basic building blocks for an InDesign dialog :

      tell application “Adobe InDesign CS4”
      activate
      set mgDialog to make dialog with properties {name:”The text at the top of the dialog”}
      tell mgDialog
      tell (make dialog column)
      tell (make border panel)
      tell (make dialog column)
      make static text with properties {static label:”Text field instruction : “, min width:160}
      end tell
      tell (make dialog column)
      set mgTextField to make text editbox with properties {edit contents:”Default Entry”, min width:200}
      make static text with properties {static label:”Additional instructions maybe”}
      end tell
      end tell
      tell (make border panel)
      tell (make dialog column)
      make static text with properties {static label:”Text next to buttons : “, min width:160}
      end tell
      tell (make dialog column)
      set mgButtons to make radiobutton group
      tell mgButtons
      set mgButton1 to make radiobutton control with properties {static label:”Button1 Label”, checked state:true}
      set mgButton2 to make radiobutton control with properties {static label:”Button2 Label”, min width:200}
      set mgButton3 to make radiobutton control with properties {static label:”Button3 Label”}
      end tell
      end tell
      end tell
      tell (make border panel)
      tell (make dialog column)
      make static text with properties {static label:”Check box instruction : “, min width:160}
      end tell
      tell (make dialog column)
      set myCheckbox1 to make checkbox control with properties {static label:”Checkbox1 label”, checked state:false, min width:200}
      set myCheckbox2 to make checkbox control with properties {static label:”Checkbox2 label”, checked state:false}
      set myCheckbox3 to make checkbox control with properties {static label:”Checkbox3 label”, checked state:true}

      end tell
      end tell
      end tell
      end tell

      set mgResult to show mgDialog
      if mgResult is true then
      –gather the results for whatever purpose you have
      destroy mgDialog
      else
      error number -128
      destroy mgDialog
      end if
      end tell

      Copy this into Script Editor (Application > Applescript) and ensure the first line matches your version of Indesign.

      This script just builds a dialog — you then need to capture the results.

      You can find some other introductory stuff over at my scripting lessons 08 and 11

      Hope that gets you started

      m.

    • #62002

      Thank you M.,

      unfortunately I am PC user.

      I 've alredy done a windows palette using java script UI but I don't get to link the text inputed with the function I want.

      I also would like the palette don't close after pressed OK button.

      Sami

    • #62003
      mac grunt
      Member

      Sorry Sami, I've got no idea about javascript.

      But there's a whole bunch of clever InDesign javascripters over at the Adobe Forums.

      Give them a go.

      m.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads