[JW Lua] Copy/Paste With FCMusicRegion()

Martin Marris mmarris at notecraft.com
Mon Dec 14 21:05:32 CET 2020


Thanks Robert. So close, yet so far.

 

Will investigate.

 

Meanwhile: I assume the other way to copy/paste is to bypass the Region approach altogether and to use note cells instead. I have messed around with several alternatives but got nowhere, but what do I know?

 

Martin

 

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

 

Unfortunately, this may be a bug in either JW Lua or Finale. It may also be limited to Windows Finale. I have no personal experience with it, because I have never used the underlying API calls in the PDK. It is unfortunate that the PDK Framework does not provide a way to call the Copy/Paste menu items in the Edit menu. This is what I would do if programming directly to the PDK. (I don't trust the Copy/Paste APIs because I don't think they get much use, and they use clip files.)

 

You could try creating the directory it wants to write the clip files in. Maybe that would help. IDK.

 

 

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

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 <mailto: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 <mailto: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

_______________________________________________
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/d053ba91/attachment.htm>


More information about the JWLua mailing list