[JW Lua] Copy/Paste With FCMusicRegion()

Robert Patterson robert at robertgpatterson.com
Mon Dec 14 21:10:31 CET 2020


I don't know what you are planning to do, but transferring the notes
individually is possible. It is also potentially quite complicated. In
addition to notes, you have to copy all the other stuff in the Mass Edit
filter window. (Or as much of it as you need.) If you go that route, you
will know Finale programming inside and out by the end of the project.

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

> 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>
> 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> *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>
> 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
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
> _______________________________________________
> 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/a4665d0a/attachment.html>


More information about the JWLua mailing list