Skip to content

Commit ccd3ba0

Browse files
chore: autopublish 2024-10-09T20:19:54Z
1 parent 7443520 commit ccd3ba0

File tree

153 files changed

+10329
-744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+10329
-744
lines changed

dist/accidental_simplify.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,62 @@ package.preload["library.utils"] = package.preload["library.utils"] or function(
379379
end
380380
return mac_value
381381
end
382+
383+
function utils.split_file_path(full_path)
384+
local path_name = finale.FCString()
385+
local file_name = finale.FCString()
386+
local file_path = finale.FCString(full_path)
387+
388+
if file_path:FindFirst("/") >= 0 or (finenv.UI():IsOnWindows() and file_path:FindFirst("\\") >= 0) then
389+
file_path:SplitToPathAndFile(path_name, file_name)
390+
else
391+
file_name.LuaString = full_path
392+
end
393+
394+
local extension = file_name.LuaString:match("^.+(%..+)$")
395+
extension = extension or ""
396+
if #extension > 0 then
397+
398+
local truncate_pos = file_name.Length - finale.FCString(extension).Length
399+
if truncate_pos > 0 then
400+
file_name:TruncateAt(truncate_pos)
401+
else
402+
extension = ""
403+
end
404+
end
405+
path_name:AssureEndingPathDelimiter()
406+
return path_name.LuaString, file_name.LuaString, extension
407+
end
408+
409+
function utils.eachfile(directory_path, recursive)
410+
if finenv.MajorVersion <= 0 and finenv.MinorVersion < 68 then
411+
error("utils.eachfile requires at least RGP Lua v0.68.", 2)
412+
end
413+
recursive = recursive or false
414+
local lfs = require('lfs')
415+
local text = require('luaosutils').text
416+
local fcstr = finale.FCString(directory_path)
417+
fcstr:AssureEndingPathDelimiter()
418+
directory_path = fcstr.LuaString
419+
local lfs_directory_path = text.convert_encoding(directory_path, text.get_utf8_codepage(), text.get_default_codepage())
420+
return coroutine.wrap(function()
421+
for lfs_file in lfs.dir(lfs_directory_path) do
422+
if lfs_file ~= "." and lfs_file ~= ".." then
423+
local utf8_file = text.convert_encoding(lfs_file, text.get_default_codepage(), text.get_utf8_codepage())
424+
local mode = lfs.attributes(lfs_directory_path .. lfs_file, "mode")
425+
if mode == "directory" then
426+
if recursive then
427+
for subdir, subfile in utils.eachfile(directory_path .. utf8_file, recursive) do
428+
coroutine.yield(subdir, subfile)
429+
end
430+
end
431+
elseif (mode == "file" or mode == "link") and lfs_file:sub(1, 2) ~= "._" then
432+
coroutine.yield(directory_path, utf8_file)
433+
end
434+
end
435+
end
436+
end)
437+
end
382438
return utils
383439
end
384440
package.preload["library.configuration"] = package.preload["library.configuration"] or function()

dist/articulation_expression_swap.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,62 @@ package.preload["library.utils"] = package.preload["library.utils"] or function(
267267
end
268268
return mac_value
269269
end
270+
271+
function utils.split_file_path(full_path)
272+
local path_name = finale.FCString()
273+
local file_name = finale.FCString()
274+
local file_path = finale.FCString(full_path)
275+
276+
if file_path:FindFirst("/") >= 0 or (finenv.UI():IsOnWindows() and file_path:FindFirst("\\") >= 0) then
277+
file_path:SplitToPathAndFile(path_name, file_name)
278+
else
279+
file_name.LuaString = full_path
280+
end
281+
282+
local extension = file_name.LuaString:match("^.+(%..+)$")
283+
extension = extension or ""
284+
if #extension > 0 then
285+
286+
local truncate_pos = file_name.Length - finale.FCString(extension).Length
287+
if truncate_pos > 0 then
288+
file_name:TruncateAt(truncate_pos)
289+
else
290+
extension = ""
291+
end
292+
end
293+
path_name:AssureEndingPathDelimiter()
294+
return path_name.LuaString, file_name.LuaString, extension
295+
end
296+
297+
function utils.eachfile(directory_path, recursive)
298+
if finenv.MajorVersion <= 0 and finenv.MinorVersion < 68 then
299+
error("utils.eachfile requires at least RGP Lua v0.68.", 2)
300+
end
301+
recursive = recursive or false
302+
local lfs = require('lfs')
303+
local text = require('luaosutils').text
304+
local fcstr = finale.FCString(directory_path)
305+
fcstr:AssureEndingPathDelimiter()
306+
directory_path = fcstr.LuaString
307+
local lfs_directory_path = text.convert_encoding(directory_path, text.get_utf8_codepage(), text.get_default_codepage())
308+
return coroutine.wrap(function()
309+
for lfs_file in lfs.dir(lfs_directory_path) do
310+
if lfs_file ~= "." and lfs_file ~= ".." then
311+
local utf8_file = text.convert_encoding(lfs_file, text.get_default_codepage(), text.get_utf8_codepage())
312+
local mode = lfs.attributes(lfs_directory_path .. lfs_file, "mode")
313+
if mode == "directory" then
314+
if recursive then
315+
for subdir, subfile in utils.eachfile(directory_path .. utf8_file, recursive) do
316+
coroutine.yield(subdir, subfile)
317+
end
318+
end
319+
elseif (mode == "file" or mode == "link") and lfs_file:sub(1, 2) ~= "._" then
320+
coroutine.yield(directory_path, utf8_file)
321+
end
322+
end
323+
end
324+
end)
325+
end
270326
return utils
271327
end
272328
package.preload["library.configuration"] = package.preload["library.configuration"] or function()

dist/barline_chooser.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4034,6 +4034,62 @@ package.preload["library.utils"] = package.preload["library.utils"] or function(
40344034
end
40354035
return mac_value
40364036
end
4037+
4038+
function utils.split_file_path(full_path)
4039+
local path_name = finale.FCString()
4040+
local file_name = finale.FCString()
4041+
local file_path = finale.FCString(full_path)
4042+
4043+
if file_path:FindFirst("/") >= 0 or (finenv.UI():IsOnWindows() and file_path:FindFirst("\\") >= 0) then
4044+
file_path:SplitToPathAndFile(path_name, file_name)
4045+
else
4046+
file_name.LuaString = full_path
4047+
end
4048+
4049+
local extension = file_name.LuaString:match("^.+(%..+)$")
4050+
extension = extension or ""
4051+
if #extension > 0 then
4052+
4053+
local truncate_pos = file_name.Length - finale.FCString(extension).Length
4054+
if truncate_pos > 0 then
4055+
file_name:TruncateAt(truncate_pos)
4056+
else
4057+
extension = ""
4058+
end
4059+
end
4060+
path_name:AssureEndingPathDelimiter()
4061+
return path_name.LuaString, file_name.LuaString, extension
4062+
end
4063+
4064+
function utils.eachfile(directory_path, recursive)
4065+
if finenv.MajorVersion <= 0 and finenv.MinorVersion < 68 then
4066+
error("utils.eachfile requires at least RGP Lua v0.68.", 2)
4067+
end
4068+
recursive = recursive or false
4069+
local lfs = require('lfs')
4070+
local text = require('luaosutils').text
4071+
local fcstr = finale.FCString(directory_path)
4072+
fcstr:AssureEndingPathDelimiter()
4073+
directory_path = fcstr.LuaString
4074+
local lfs_directory_path = text.convert_encoding(directory_path, text.get_utf8_codepage(), text.get_default_codepage())
4075+
return coroutine.wrap(function()
4076+
for lfs_file in lfs.dir(lfs_directory_path) do
4077+
if lfs_file ~= "." and lfs_file ~= ".." then
4078+
local utf8_file = text.convert_encoding(lfs_file, text.get_default_codepage(), text.get_utf8_codepage())
4079+
local mode = lfs.attributes(lfs_directory_path .. lfs_file, "mode")
4080+
if mode == "directory" then
4081+
if recursive then
4082+
for subdir, subfile in utils.eachfile(directory_path .. utf8_file, recursive) do
4083+
coroutine.yield(subdir, subfile)
4084+
end
4085+
end
4086+
elseif (mode == "file" or mode == "link") and lfs_file:sub(1, 2) ~= "._" then
4087+
coroutine.yield(directory_path, utf8_file)
4088+
end
4089+
end
4090+
end
4091+
end)
4092+
end
40374093
return utils
40384094
end
40394095
package.preload["library.localization"] = package.preload["library.localization"] or function()

dist/baseline_move_reset.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,62 @@ package.preload["library.utils"] = package.preload["library.utils"] or function(
267267
end
268268
return mac_value
269269
end
270+
271+
function utils.split_file_path(full_path)
272+
local path_name = finale.FCString()
273+
local file_name = finale.FCString()
274+
local file_path = finale.FCString(full_path)
275+
276+
if file_path:FindFirst("/") >= 0 or (finenv.UI():IsOnWindows() and file_path:FindFirst("\\") >= 0) then
277+
file_path:SplitToPathAndFile(path_name, file_name)
278+
else
279+
file_name.LuaString = full_path
280+
end
281+
282+
local extension = file_name.LuaString:match("^.+(%..+)$")
283+
extension = extension or ""
284+
if #extension > 0 then
285+
286+
local truncate_pos = file_name.Length - finale.FCString(extension).Length
287+
if truncate_pos > 0 then
288+
file_name:TruncateAt(truncate_pos)
289+
else
290+
extension = ""
291+
end
292+
end
293+
path_name:AssureEndingPathDelimiter()
294+
return path_name.LuaString, file_name.LuaString, extension
295+
end
296+
297+
function utils.eachfile(directory_path, recursive)
298+
if finenv.MajorVersion <= 0 and finenv.MinorVersion < 68 then
299+
error("utils.eachfile requires at least RGP Lua v0.68.", 2)
300+
end
301+
recursive = recursive or false
302+
local lfs = require('lfs')
303+
local text = require('luaosutils').text
304+
local fcstr = finale.FCString(directory_path)
305+
fcstr:AssureEndingPathDelimiter()
306+
directory_path = fcstr.LuaString
307+
local lfs_directory_path = text.convert_encoding(directory_path, text.get_utf8_codepage(), text.get_default_codepage())
308+
return coroutine.wrap(function()
309+
for lfs_file in lfs.dir(lfs_directory_path) do
310+
if lfs_file ~= "." and lfs_file ~= ".." then
311+
local utf8_file = text.convert_encoding(lfs_file, text.get_default_codepage(), text.get_utf8_codepage())
312+
local mode = lfs.attributes(lfs_directory_path .. lfs_file, "mode")
313+
if mode == "directory" then
314+
if recursive then
315+
for subdir, subfile in utils.eachfile(directory_path .. utf8_file, recursive) do
316+
coroutine.yield(subdir, subfile)
317+
end
318+
end
319+
elseif (mode == "file" or mode == "link") and lfs_file:sub(1, 2) ~= "._" then
320+
coroutine.yield(directory_path, utf8_file)
321+
end
322+
end
323+
end
324+
end)
325+
end
270326
return utils
271327
end
272328
package.preload["library.configuration"] = package.preload["library.configuration"] or function()

dist/chord_accidental_adjust_down.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,62 @@ package.preload["library.utils"] = package.preload["library.utils"] or function(
267267
end
268268
return mac_value
269269
end
270+
271+
function utils.split_file_path(full_path)
272+
local path_name = finale.FCString()
273+
local file_name = finale.FCString()
274+
local file_path = finale.FCString(full_path)
275+
276+
if file_path:FindFirst("/") >= 0 or (finenv.UI():IsOnWindows() and file_path:FindFirst("\\") >= 0) then
277+
file_path:SplitToPathAndFile(path_name, file_name)
278+
else
279+
file_name.LuaString = full_path
280+
end
281+
282+
local extension = file_name.LuaString:match("^.+(%..+)$")
283+
extension = extension or ""
284+
if #extension > 0 then
285+
286+
local truncate_pos = file_name.Length - finale.FCString(extension).Length
287+
if truncate_pos > 0 then
288+
file_name:TruncateAt(truncate_pos)
289+
else
290+
extension = ""
291+
end
292+
end
293+
path_name:AssureEndingPathDelimiter()
294+
return path_name.LuaString, file_name.LuaString, extension
295+
end
296+
297+
function utils.eachfile(directory_path, recursive)
298+
if finenv.MajorVersion <= 0 and finenv.MinorVersion < 68 then
299+
error("utils.eachfile requires at least RGP Lua v0.68.", 2)
300+
end
301+
recursive = recursive or false
302+
local lfs = require('lfs')
303+
local text = require('luaosutils').text
304+
local fcstr = finale.FCString(directory_path)
305+
fcstr:AssureEndingPathDelimiter()
306+
directory_path = fcstr.LuaString
307+
local lfs_directory_path = text.convert_encoding(directory_path, text.get_utf8_codepage(), text.get_default_codepage())
308+
return coroutine.wrap(function()
309+
for lfs_file in lfs.dir(lfs_directory_path) do
310+
if lfs_file ~= "." and lfs_file ~= ".." then
311+
local utf8_file = text.convert_encoding(lfs_file, text.get_default_codepage(), text.get_utf8_codepage())
312+
local mode = lfs.attributes(lfs_directory_path .. lfs_file, "mode")
313+
if mode == "directory" then
314+
if recursive then
315+
for subdir, subfile in utils.eachfile(directory_path .. utf8_file, recursive) do
316+
coroutine.yield(subdir, subfile)
317+
end
318+
end
319+
elseif (mode == "file" or mode == "link") and lfs_file:sub(1, 2) ~= "._" then
320+
coroutine.yield(directory_path, utf8_file)
321+
end
322+
end
323+
end
324+
end)
325+
end
270326
return utils
271327
end
272328
package.preload["library.configuration"] = package.preload["library.configuration"] or function()

dist/chord_accidental_adjust_up.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,62 @@ package.preload["library.utils"] = package.preload["library.utils"] or function(
267267
end
268268
return mac_value
269269
end
270+
271+
function utils.split_file_path(full_path)
272+
local path_name = finale.FCString()
273+
local file_name = finale.FCString()
274+
local file_path = finale.FCString(full_path)
275+
276+
if file_path:FindFirst("/") >= 0 or (finenv.UI():IsOnWindows() and file_path:FindFirst("\\") >= 0) then
277+
file_path:SplitToPathAndFile(path_name, file_name)
278+
else
279+
file_name.LuaString = full_path
280+
end
281+
282+
local extension = file_name.LuaString:match("^.+(%..+)$")
283+
extension = extension or ""
284+
if #extension > 0 then
285+
286+
local truncate_pos = file_name.Length - finale.FCString(extension).Length
287+
if truncate_pos > 0 then
288+
file_name:TruncateAt(truncate_pos)
289+
else
290+
extension = ""
291+
end
292+
end
293+
path_name:AssureEndingPathDelimiter()
294+
return path_name.LuaString, file_name.LuaString, extension
295+
end
296+
297+
function utils.eachfile(directory_path, recursive)
298+
if finenv.MajorVersion <= 0 and finenv.MinorVersion < 68 then
299+
error("utils.eachfile requires at least RGP Lua v0.68.", 2)
300+
end
301+
recursive = recursive or false
302+
local lfs = require('lfs')
303+
local text = require('luaosutils').text
304+
local fcstr = finale.FCString(directory_path)
305+
fcstr:AssureEndingPathDelimiter()
306+
directory_path = fcstr.LuaString
307+
local lfs_directory_path = text.convert_encoding(directory_path, text.get_utf8_codepage(), text.get_default_codepage())
308+
return coroutine.wrap(function()
309+
for lfs_file in lfs.dir(lfs_directory_path) do
310+
if lfs_file ~= "." and lfs_file ~= ".." then
311+
local utf8_file = text.convert_encoding(lfs_file, text.get_default_codepage(), text.get_utf8_codepage())
312+
local mode = lfs.attributes(lfs_directory_path .. lfs_file, "mode")
313+
if mode == "directory" then
314+
if recursive then
315+
for subdir, subfile in utils.eachfile(directory_path .. utf8_file, recursive) do
316+
coroutine.yield(subdir, subfile)
317+
end
318+
end
319+
elseif (mode == "file" or mode == "link") and lfs_file:sub(1, 2) ~= "._" then
320+
coroutine.yield(directory_path, utf8_file)
321+
end
322+
end
323+
end
324+
end)
325+
end
270326
return utils
271327
end
272328
package.preload["library.configuration"] = package.preload["library.configuration"] or function()

0 commit comments

Comments
 (0)