[JW Lua] Unlinking an FCSeparateMeasureNumber object - revisted

Jan Angermüller jan at angermueller.com
Mon Aug 21 21:23:32 CEST 2017


Jari,

this question below has never been answered.
But today Robert Patterson wrote on the Finale mailing list:
"...when Finale makes it possible for plugins to unlink measure number 
position/visibility. Currently plugins can't do it, but Makemusic has 
stated that it is planned."
So I assume this is the answer to the question: unlinking is simply not 
possible at the moment.
Or what do you think?

Best,
Jan



Am 21.02.2017 um 17:59 schrieb Jan Angermüller:
> Jari et all,
>
> has anybody had success unlinking a FCSeparateMeasureNumber object ? 
> (i.e. unlinking between score and parts)
> Below is the code that I use for relinking - it works fine so far.
> But unlinking ... ? When I change and save the FCSeperateMeasureNumber 
> object later in part scope, it always also changes the main object 
> from the score.
> Is this a JW Lua bug ? Or how can I separate score and part objects here ?
>
> Best,
> Jan
>
>
> --Relink measure numbers
> local parts=finale.FCParts()
> parts:LoadAll()
> local region=finale.FCMusicRegion()
> region:SetCurrentSelection()
> local measregions=finale.FCMeasureNumberRegions()
> measregions:LoadAll()
>
> for m in each(measregions) do
>     for i=region.StartSlot,region.EndSlot,1 do
>         local j=region:CalcStaffNumber(i)
>         for k=region.StartMeasure,region.EndMeasure,1 do
>            local cell=finale.FCCell(k,j)
>            local measnums=finale.FCSeparateMeasureNumbers()
>            measnums:LoadAllInCell(cell)
>            for measnum in each(measnums) do
>               if measnum.RegionNumberID==m.ItemNo then
>                   local deleted=false
>                   for p in each(parts) do
>                     if not p:IsScore()
>                         and not p:IsCurrent()
>                         and p:IsStaffIncluded(j) then                 
> --iterate through all parts, except score
>                         p:SwitchTo()
>                             local 
> measnums2=finale.FCSeparateMeasureNumbers()
>                             measnums2:LoadAllInCell(cell)
>                             for measnum2 in each(measnums2) do
>                                 if 
> (measnum2.RegionNumberID==measnum.RegionNumberID)  then
>                                     measnum2:DeleteData()
>                                     deleted=true
>                                 end
>                             end
>                         p:SwitchBack()
>                     end
>                  end
>                  if deleted then
>                     measnum:ConnectCell(cell)
>                     measnum:AssignMeasureNumberRegion(m)
>                     measnum:SaveNew()
>                  end
>               end
>           end
>        end
>     end
> end
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20170821/6a024f59/attachment.html>


More information about the JWLua mailing list