[JW Lua] Copy/Paste With FCMusicRegion()

Martin Marris mmarris at notecraft.com
Mon Dec 14 20:46:14 CET 2020


Hi Robert,

 

Do you mean like this? It’s not working, I get a variant of the same message box error notification:

 

local musicregion = finale.FCMusicRegion()

 

musicregion.StartMeasure = 1

musicregion.EndMeasure = 2

musicregion:SetInDocument() 

musicregion:CopyMusic()

 

musicregion.StartMeasure = 3

musicregion.EndMeasure = 4

musicregion:SetInDocument() 

musicregion:PasteMusic()

 

musicregion:ReleaseMusic()

 

Martin

 

From: JWLua <jwlua-bounces at jwmusic.nu> On Behalf Of Robert Patterson
Sent: Monday, December 14, 2020 19:36
To: The JW Lua script plug-in. <jwlua at jwmusic.nu>
Subject: Re: [JW Lua] Copy/Paste With FCMusicRegion()

 

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 <mailto: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 <mailto: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/b94de3f7/attachment.htm>


More information about the JWLua mailing list