<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div id="gt-res-content" class="almost_half_cell">
      <div style="zoom: 1;" dir="ltr"><span id="result_box" lang="en"><span
            class="hps">Hello</span> <span class="hps">Jari</span><br>
          <br>
          <span class="hps">I'm</span> <span class="hps">French</span>
          <span class="hps">(excuse</span> <span class="hps">my English</span><span>)</span>
          <span class="hps">and I use</span> <span class="hps atn">"</span><span>FINAL</span><span>E"</span>
          <span class="hps">for about 20 years</span><span>.</span><br>
          <span class="hps">I also participate in</span> <span
            class="hps">a</span> <span class="hps">french</span> <span
            class="hps">forum</span> <span class="hps atn">(</span><a
            href="http://finale-logiciel-aide-gravure-musicale.eu/"><span>http://finale-logiciel-aide-gravure-musicale.eu/</span></a><span>)</span>
          <span class="hps"><br>
            or</span> <span class="hps">the</span> <span class="hps">much
            talked about</span> <span class="hps">you</span> <span
            class="hps">and your</span> <span class="hps">wonderful</span>
          <span class="hps">plugins </span><span class="hps">that are
            quick and</span> <span class="hps">ergonomic</span><span>.</span><br>
          <span class="hps">In</span> <span class="hps">my spare</span>
          <span class="hps">time</span> <span class="hps">I do a little</span>
          <span class="hps">programming</span> <span class="hps">and</span>
          <span class="hps">I tried to</span> <span class="hps">write a</span>
          <span class="hps">Lua</span> <span class="hps">script.</span><br>
          <span class="hps">For</span> <span class="hps">my needs</span><span>,
            I wrote</span> <span class="hps">this</span> <span
            class="hps">script that creates a</span> <span class="hps">text
            visible</span> <span class="hps">only on a part</span><span>.</span><br>
          <br>
          ---<br>
          function plugindef()<br>
             -- This function and the 'finaleplugin' namespace<br>
             -- are both reserved for the plug-in definition.<br>
             finaleplugin.Author = "CHRIS"<br>
             finaleplugin.Date = "13/11/2013"<br>
             finaleplugin.CategoryTags = "Text"<br>
             return "Texte sur Part", "", "Cree un texte visible
          uniquement sur la part active"<br>
          end<br>
          <br>
          <br>
          -- demander texte a l'utilisateur<br>
          local dialog = finenv.UserValueInput()<br>
          dialog.Title = "CHRIS - Texte sur Part"<br>
          dialog:SetTypes("String")<br>
          dialog:SetDescriptions("Veuillez entrer votre texte :")<br>
          local returnvalues = dialog:Execute()<br>
          <br>
          -- si annuler -> fin<br>
          if returnvalues == nil then return end<br>
          <br>
          -- creer la chaine de caracteres Enigma<br>
          local myText = finale.FCString()<br>
          myText.LuaString = "^fontTxt(Arial, 0)^size(8)^nfx(0)" ..
          returnvalues[1]<br>
          <br>
          -- creer un objet texte attachee a une page<br>
          local myPageText = finale.FCPageText()<br>
          <br>
          -- positionner le texte<br>
          myPageText:SetHorizontalAlignment(finale.TEXTHORIZALIGN_LEFT)<br>
          myPageText:SetVerticalAlignment(finale.TEXTVERTALIGN_BOTTOM)<br>
          <br>
          -- cacher le texte globalement<br>
          myPageText:SetVisible(false)<br>
          <br>
          -- sauver<br>
          myPageText:SaveNewTextBlock(myText)<br>
          myPageText:SaveNew(1)<br>
          <br>
          -- memoriser l'ID du TextBlock<br>
          local id=myPageText.TextBlockID<br>
          <br>
          -- charger tous les textes attaches aux pages<br>
          pagetexts = finale.FCPageTexts()<br>
          pagetexts:LoadAll()<br>
          <br>
          -- rendre visible notre texte sur la part active<br>
          for pagetext in each(pagetexts) do<br>
               if pagetext.TextBlockID  == id  then<br>
                  pagetext:SetVisible(true)<br>
                  pagetext:Save()<br>
                  break<br>
               end <br>
          end<br>
          ---<br>
          <br>
          <span class="hps">But I</span> <span class="hps">did not
            understand</span> <span class="hps">how</span> <span
            class="hps">stored</span> <span class="hps">non</span> <span
            class="hps">linked</span> <span class="hps">properties.</span>
          <span class="hps">(like</span> <span class="hps">the</span> <span
            class="hps">"Visible" property</span><span>)</span><span>.</span><br>
          <span class="hps">And I</span> <span class="hps">do not know
            if</span> <span class="hps">my</span> <span class="hps">text
            search</span> <span class="hps">by</span> <span
            class="hps">TextBlockID</span> <span class="hps">is good.</span><br>
          <br>
          <span class="hps">Otherwise</span> <span class="hps">I also</span>
          <span class="hps">made ​​this little</span> <span class="hps">script
          </span></span><span id="result_box" lang="en"><span
            class="hps"><span class="hps">to create</span> <span
              class="hps">a group,</span> but</span> <span class="hps">it
            does not work</span><span class="hps"></span><span>:<br>
            <br>
            ---<br>
          </span>local myGroup = finale.FCGroup()<br>
          myGroup:SetStartStaff(1)<br>
          myGroup:SetEndStaff(2)<br>
          myGroup:SetStartMeasure (1)<br>
          myGroup:SetEndMeasure(32767)<br>
          myGroup.BarlineShapeID=0<br>
          myGroup.BarlineStyle=1<br>
          myGroup.BarlineUse=false<br>
          myGroup.BracketID=2           --finale.BRACKET_PIANOBRAC<br>
          myGroup.FullNameHorizontalAdjust=-48<br>
          print(myGroup:SaveNew(1))<br>
          ---<br>
          <br>
          <span class="hps">In the future</span> <span class="hps">I
            will try to</span> <span class="hps">make more</span> <span
            class="hps">short messages.</span><br>
          <span class="hps">T</span><span class="hps">hank you</span> <span
            class="hps">for</span> <span class="hps">all your work.<br>
            <br>
            Bests regards<br>
            <br>
            Chris<br>
          </span></span></div>
    </div>
    <div id="gt-res-tools">
      <div id="gt-res-tools-l">
        <div id="gt-pb-star">
          <div aria-hidden="false" class="goog-toolbar-button
            goog-inline-block trans-pb-button" role="button"
            tabindex="0" aria-label="Se connecter pour enregistrer la
            traduction dans le lexique" data-tooltip="Se connecter pour
            enregistrer la traduction dans le lexique"
            data-tooltip-align="t,c" unselectable="on"><span
              class="jfk-button-img" unselectable="on"></span></div>
        </div>
        <div aria-hidden="false" id="gt-res-select" class="select-button
          goog-toolbar-button" role="button" tabindex="0"
          aria-label="Tout sélectionner" data-tooltip="Tout
          sélectionner" data-tooltip-align="t,c" unselectable="on"><span
            class="jfk-button-img" unselectable="on"><br>
          </span></div>
      </div>
    </div>
  </body>
</html>