[JW Lua] Lua Script
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Thu Sep 19 08:16:21 CEST 2013
On 2013-09-19 05:31, Steve Fiskum wrote:
> I'm looking for a way to uncheck "Float Rest" from the Speedy Edit frame throughout
> all entries throughout the entire file. Would this be possible in Lua?
There seems to be some strange Finale (testing on 2012c) bug when I'm
just setting "entry.FloatingRest = false", since I always need to do the
changes TWICE to get the change to stick in Finale. (The changes occur
the first time, but Finale doesn't record them properly.)
So this is a crazy work-around-bug approach that would do the job the
first time:
---
local region = finale.FCMusicRegion()
region:SetFullDocument()
for entry in eachentrysaved(region) do
if entry:IsRest() then
if entry.FloatingRest then entry.FloatingRest = false end
end
end
for entry in eachentrysaved(region) do
if entry:IsRest() then
entry.FloatingRest = false
end
end
---
But here's a more clean, alternative version that works (it works a bit
different):
---
local region = finale.FCMusicRegion()
region:SetFullDocument()
for entry in eachentrysaved(region) do
if entry:IsRest() then
entry:MakeMovableRest()
end
end
---
Alternatively, you can replace "entry:MakeMovableRest()" with
"entry:SetRestDisplacement(6)" in the alternative version, which would
center the movable rest vertically on a treble clef staff.
Also, in the "Plug-in Def" dialog, check "Require Score View" so the
script will only be runnable when you're in the score.
Best regards,
Jari Williamsson
More information about the JWLua
mailing list