[JW Lua] Expression Handles

Jesse Wiener jesse.wiener at gmail.com
Fri Oct 12 04:46:33 CEST 2018


Hello!

"First time, long time", as they say... JW Lua is amazing - The amount of
time I've saved...

Anyway, sorry if this has been covered, but I can't seem to find anything
in the docs or the archives.

I'm working on a script that would take an expression (or multiple
expressions) I've selected and change its assignment so that it only
appears in parts, not in the score. However, because I want it to apply to
specific expressions within a given region, I can't use a measure
selection, which would change the assignment of everything in that region.

Is there a way to access expressions by which handles are selected rather
than by using finenv.Region()?

I feel like I could be missing something obvious, but I could use a hand.
My code for where I'm starting (the finenv.Region version, which works) is
below.

Thanks so much!

JW
---
local region = finenv.Region()
local expressions = finale.FCExpressions()

expressions:LoadAllForRegion(region)

for expression in each(expressions) do
expression.ScoreAssignment = false
expression.PartAssignment = true
expression:Save()
end
---

-- 
Jesse Wiener
Composer: www.jessewiener.com
Copyist: www.JAWLinemusic.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20181011/927832b9/attachment-0001.html>


More information about the JWLua mailing list