<div dir="ltr">Also, I may have sent you early betas. Make sure you are using the actual released 0.58.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 11, 2022 at 7:22 AM Robert Patterson <<a href="mailto:robert@robertgpatterson.com">robert@robertgpatterson.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Your test script works for me. That error message sounds like you either are running the script on JW Lua or on an earlier version of RGP Lua. You can confirm the PDK version by adding this line to the beginning of your script:</div><div><br></div><div>finenv.UI():AlertNeutral("test", finenv.StringVersion)</div><div><br></div><div>When I run it, it displays "0.58".<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 11, 2022 at 6:41 AM Carl Vine <<a href="mailto:carlvine@iinet.net.au" target="_blank">carlvine@iinet.net.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I started off with “SaveNewWithType" in RGP0.58 which I noticed in your Class Browser, Robert, absent from JW’s original. And indeed started with the DEFAULTCATID_TECHNIQUETEXT type (“5”). But that method keeps throwing up the error: 'attempt to call method “SaveNewWithType” (a nil value).’<br>
<br>
Here’s a basic test case:<br>
—  ============<br>
local new_cat = finale.FCCategoryDef()<br>
new_cat:Load(finale.DEFAULTCATID_TECHNIQUETEXT)<br>
local s = finale.FCString()<br>
s.LuaString = "Cue Names"<br>
new_cat:SetName(s)<br>
if new_cat:SaveNewWithType(finale.DEFAULTCATID_TECHNIQUETEXT) then<br>
      finenv.UI():AlertNeutral("test", "success")<br>
else<br>
      finenv.UI():AlertNeutral("test", "failure")<br>
end<br>
—  ============<br>
<br>
Carl<br>
<br>
> On 11 Jan 2022, at 10:00 pm, <a href="mailto:jwlua-request@jwmusic.nu" target="_blank">jwlua-request@jwmusic.nu</a> wrote:<br>
> <br>
> Send JWLua mailing list submissions to<br>
>       <a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a><br>
> <br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
>       <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
> or, via email, send a message with subject or body 'help' to<br>
>       <a href="mailto:jwlua-request@jwmusic.nu" target="_blank">jwlua-request@jwmusic.nu</a><br>
> <br>
> You can reach the person managing the list at<br>
>       <a href="mailto:jwlua-owner@jwmusic.nu" target="_blank">jwlua-owner@jwmusic.nu</a><br>
> <br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of JWLua digest..."<br>
> <br>
> <br>
> Today's Topics:<br>
> <br>
>   1. Re: Creating new text expression category (Robert Patterson)<br>
>   2. Re: Creating new text expression category (Robert Patterson)<br>
>   3. Re: JWLua Digest, Vol 87, Issue 1 (Jacob Winkler)<br>
> <br>
> <br>
> ----------------------------------------------------------------------<br>
> <br>
> Message: 1<br>
> Date: Mon, 10 Jan 2022 06:45:46 -0600<br>
> From: Robert Patterson <<a href="mailto:robert@robertgpatterson.com" target="_blank">robert@robertgpatterson.com</a>><br>
> To: "The JW Lua script plug-in." <<a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a>><br>
> Subject: Re: [JW Lua] Creating new text expression category<br>
> Message-ID:<br>
>       <<a href="mailto:CAACnceuPyULdeMMWvmNq%2BUkgkXkBx1iei0Fgq-zCY53YxgfYHw@mail.gmail.com" target="_blank">CAACnceuPyULdeMMWvmNq+UkgkXkBx1iei0Fgq-zCY53YxgfYHw@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
> <br>
> SaveNewWithType should work in RGP Lua 0.58+. The others will not. If you<br>
> have an example of SaveNewWithType that fails to create a new category,<br>
> please post a sample script that fails.<br>
> <br>
> However, creating a new category is just the beginning. To assign<br>
> expressions to it requires additional code for each expression.<br>
> <br>
> <br>
> On Mon, Jan 10, 2022 at 1:29 AM Carl Vine <<a href="mailto:carlvine@iinet.net.au" target="_blank">carlvine@iinet.net.au</a>> wrote:<br>
> <br>
>> Can anyone help?<br>
>> <br>
>> I?m loading the standard  TECHNIQUETEXT FCCategoryDef (ItemNo 5), changing<br>
>> the name and some values, then trying to Save() as a new category.<br>
>> <br>
>> SaveNew(), SaveAs(new_unique_id) and SaveNewWithType(some_type) all fail.<br>
>> Save() succeeds but doesn?t change or update the CategoryDefs collection.<br>
>> <br>
>> Carl<br>
>> <br>
>> <br>
>> _______________________________________________<br>
>> JWLua mailing list<br>
>> <a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
>> <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
>> <br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220110/bf516a7b/attachment-0001.html" rel="noreferrer" target="_blank">http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220110/bf516a7b/attachment-0001.html</a>><br>
> <br>
> ------------------------------<br>
> <br>
> Message: 2<br>
> Date: Mon, 10 Jan 2022 07:06:13 -0600<br>
> From: Robert Patterson <<a href="mailto:robert@robertgpatterson.com" target="_blank">robert@robertgpatterson.com</a>><br>
> To: "The JW Lua script plug-in." <<a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a>><br>
> Subject: Re: [JW Lua] Creating new text expression category<br>
> Message-ID:<br>
>       <CAACncet17Dt92LYNBRdEwCH=554v=<a href="mailto:P-uxXArpnNSAybG-AkyZg@mail.gmail.com" target="_blank">P-uxXArpnNSAybG-AkyZg@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
> <br>
> Also, I just realized the documentation may not be clear. The "type" is not<br>
> just "some type". It must be one of the CATEGORY_DEDAULTIDS constants. In<br>
> your case, probably TECHNIQUETEXT.<br>
> <br>
> On Mon, Jan 10, 2022 at 6:45 AM Robert Patterson <<br>
> <a href="mailto:robert@robertgpatterson.com" target="_blank">robert@robertgpatterson.com</a>> wrote:<br>
> <br>
>> SaveNewWithType should work in RGP Lua 0.58+. The others will not. If you<br>
>> have an example of SaveNewWithType that fails to create a new category,<br>
>> please post a sample script that fails.<br>
>> <br>
>> However, creating a new category is just the beginning. To assign<br>
>> expressions to it requires additional code for each expression.<br>
>> <br>
>> <br>
>> On Mon, Jan 10, 2022 at 1:29 AM Carl Vine <<a href="mailto:carlvine@iinet.net.au" target="_blank">carlvine@iinet.net.au</a>> wrote:<br>
>> <br>
>>> Can anyone help?<br>
>>> <br>
>>> I?m loading the standard  TECHNIQUETEXT FCCategoryDef (ItemNo 5),<br>
>>> changing the name and some values, then trying to Save() as a new category.<br>
>>> <br>
>>> SaveNew(), SaveAs(new_unique_id) and SaveNewWithType(some_type) all fail.<br>
>>> Save() succeeds but doesn?t change or update the CategoryDefs collection.<br>
>>> <br>
>>> Carl<br>
>>> <br>
>>> <br>
>>> _______________________________________________<br>
>>> JWLua mailing list<br>
>>> <a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
>>> <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
>>> <br>
>> <br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220110/af23daad/attachment-0001.html" rel="noreferrer" target="_blank">http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220110/af23daad/attachment-0001.html</a>><br>
> <br>
> ------------------------------<br>
> <br>
> Message: 3<br>
> Date: Mon, 10 Jan 2022 07:32:23 -0800<br>
> From: Jacob Winkler <<a href="mailto:jacob.winkler@mac.com" target="_blank">jacob.winkler@mac.com</a>><br>
> To: <a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a><br>
> Subject: Re: [JW Lua] JWLua Digest, Vol 87, Issue 1<br>
> Message-ID: <<a href="mailto:3DD5BF11-3E50-4659-B4B4-4D5EE2CA7AE5@mac.com" target="_blank">3DD5BF11-3E50-4659-B4B4-4D5EE2CA7AE5@mac.com</a>><br>
> Content-Type: text/plain; charset=utf-8<br>
> <br>
> From my experience and understanding, you can access existing FCCategoryDefs along with their associated parameters, but you cannot create them. Perhaps this will change in the future with RGP Lua? I certainly would appreciate the addition as I?ve made several inelegant scripts that contain logic along the lines of ?if category x exists use it, else use miscellaneous ?.<br>
> <br>
> Sent from my iPhone<br>
> <br>
>> On Jan 10, 2022, at 3:00 AM, <a href="mailto:jwlua-request@jwmusic.nu" target="_blank">jwlua-request@jwmusic.nu</a> wrote:<br>
>> <br>
>> ?Send JWLua mailing list submissions to<br>
>>   <a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a><br>
>> <br>
>> To subscribe or unsubscribe via the World Wide Web, visit<br>
>>   <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
>> or, via email, send a message with subject or body 'help' to<br>
>>   <a href="mailto:jwlua-request@jwmusic.nu" target="_blank">jwlua-request@jwmusic.nu</a><br>
>> <br>
>> You can reach the person managing the list at<br>
>>   <a href="mailto:jwlua-owner@jwmusic.nu" target="_blank">jwlua-owner@jwmusic.nu</a><br>
>> <br>
>> When replying, please edit your Subject line so it is more specific<br>
>> than "Re: Contents of JWLua digest..."<br>
>> <br>
>> <br>
>> Today's Topics:<br>
>> <br>
>>  1. Creating new text expression category (Carl Vine)<br>
>> <br>
>> <br>
>> ----------------------------------------------------------------------<br>
>> <br>
>> Message: 1<br>
>> Date: Mon, 10 Jan 2022 15:51:06 +1100<br>
>> From: Carl Vine <<a href="mailto:carlvine@iinet.net.au" target="_blank">carlvine@iinet.net.au</a>><br>
>> To: <a href="mailto:jwlua@jwmusic.nu" target="_blank">jwlua@jwmusic.nu</a><br>
>> Subject: [JW Lua] Creating new text expression category<br>
>> Message-ID: <<a href="mailto:ED819027-5540-438E-B23C-FF57DB07B431@iinet.net.au" target="_blank">ED819027-5540-438E-B23C-FF57DB07B431@iinet.net.au</a>><br>
>> Content-Type: text/plain;    charset=utf-8<br>
>> <br>
>> Can anyone help?<br>
>> <br>
>> I?m loading the standard  TECHNIQUETEXT FCCategoryDef (ItemNo 5), changing the name and some values, then trying to Save() as a new category.<br>
>> <br>
>> SaveNew(), SaveAs(new_unique_id) and SaveNewWithType(some_type) all fail.<br>
>> Save() succeeds but doesn?t change or update the CategoryDefs collection.<br>
>> <br>
>> Carl<br>
>> <br>
>> <br>
>> <br>
>> <br>
>> ------------------------------<br>
>> <br>
>> Subject: Digest Footer<br>
>> <br>
>> _______________________________________________<br>
>> JWLua mailing list<br>
>> <a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
>> <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
>> <br>
>> <br>
>> ------------------------------<br>
>> <br>
>> End of JWLua Digest, Vol 87, Issue 1<br>
>> ************************************<br>
> <br>
> <br>
> <br>
> ------------------------------<br>
> <br>
> Subject: Digest Footer<br>
> <br>
> _______________________________________________<br>
> JWLua mailing list<br>
> <a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
> <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
> <br>
> <br>
> ------------------------------<br>
> <br>
> End of JWLua Digest, Vol 87, Issue 2<br>
> ************************************<br>
<br>
<br>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>
</blockquote></div>