[JW Lua] Copy/Paste With FCMusicRegion()

Robert Patterson robert at robertgpatterson.com
Mon Dec 14 20:36:12 CET 2020


Try calling musicregion:SetInDocument() after setting the start and end
measures (both times).

On Mon, Dec 14, 2020 at 1:18 PM Martin Marris <mmarris at notecraft.com> wrote:

> I am trying to create a Region programmatically (rather than through user
> interaction).
>
>
>
> Then, copy/paste between regions.
>
>
>
> But if I run the following simple script:
>
>
>
> local musicregion = finale.FCMusicRegion()
>
> musicregion.StartMeasure = 1
>
> musicregion.EndMeasure = 2
>
> musicregion:CopyMusic()
>
> musicregion.StartMeasure = 3
>
> musicregion.EndMeasure = 4
>
> musicregion:PasteMusic()
>
> musicregion:ReleaseMusic()
>
>
>
> I get this result:
>
>
>
> Message box: Title “Finale” and text “Cannot read library
> c:\users\myusername\AppDate\LocalLow\Fin33B.tmp”.
>
>
>
> Why?
>
>
>
> Martin
>
>
> _______________________________________________
> 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/20201214/590bb55c/attachment.html>


More information about the JWLua mailing list