|
|
MakeMusic Forum > Public Forums > Finale - Windows - FORUM HAS MOVED! > Finale 2914 Get count of selected measures? | Forum Quick Jump
|
| Motet Isorhythmic
Date Joined Dec 2002 Total Posts : 12849 | Posted 8/5/2016 12:18 PM (GMT -6) | | |
| Charles Lawrence Registered Member
Date Joined Dec 2009 Total Posts : 3638 | Posted 8/5/2016 5:40 PM (GMT -6) | | I have written a small JW Lua script to count the number of selected measures. Any partial measures are included in the count. If no selection is made, then the entire document is chosen. Any JW Lua script can be added to the plug-ins menu so that you do not need to run the JW Lua plug-in, just choose the script from the drop down menu.
BTW: Some of the items in the Count Items plug-in display are confusing, e.g. Page Text. Measure Numbers seems to be the number of measures with a measure number displayed. "Anything is possible if you don't know what you are talking about!"
Windows 10 Professional (x64) (build 10586)
3.50 gigahertz Intel Core i7-5930K, Multi-core (6 total), Hyper-threaded (12 total)
32638 Megabytes Usable Installed Memory, 17514.37 Gigabytes Usable Hard Drive Capacity NVIDIA GeForce GTX 980 - 4GB [Display adapter]
ASUS Rampage V Extreme motherboard, Realtek HD Audio
Finale 2014.5.6359 Garritan GPO4.02
Cakewalk SONAR X3 - (X3e build 244) - x64, Sound Forge Audio Studio 10.0, Audacity 2.1.0 Sharpeye 2.68, PhotoScore Ultimate 7.0.2, SmartScore X2 Pro 10.5.8
"There is a world of difference between a person who has a big problem and a person who makes a problem big." – John MaxwellFile Attachment : MeasureCount.lua 1KB (text/plain) This file has been downloaded 264 time(s). | Back to Top | |
| Motet Isorhythmic
Date Joined Dec 2002 Total Posts : 12849 | Posted 8/5/2016 11:08 PM (GMT -6) | | |
| mm Registered Member
Date Joined Mar 1999 Total Posts : 715 | Posted 8/6/2016 12:40 AM (GMT -6) | | Charles said... Any JW Lua script can be added to the plug-ins menu How exactly? (I saved the script as measurecount.fxt and put it into a Plug-in folder, but it doesn't show. I know nothing about Lua scripts, though ...)
Another try - managed to create a new plug-in in Finale script, but running it just brings up the Measure Attributes screen. ?? Finale 3.7 - 2014.5, GPO4.02/5, Cubase, ProTools, ASUS laptop, Intel Core i5, 8GB RAM, WIN 8.1 (64-bit), 18.4'' display, M-Audio Keystation 49 + Mini 32 keyboardsPost Edited (mm) : 8/6/2016 12:52:30 AM (GMT-5) | Back to Top | |
| Charles Lawrence Registered Member
Date Joined Dec 2009 Total Posts : 3638 | Posted 8/6/2016 8:57 AM (GMT -6) | | mm,
To add any JW Lua script to the menu:
- Run the JW Lua plug-in first. This is where you set things up. scripts with lua file extensions are different than standard plug-ins with the fxt file extension. You must have downloaded the plug-in from JW's site and installed it.
- In the JW Lua plug-in dialog box, select the "Manager" tab along the top.
- In the top pane called "Plug-in Groups" there is a pre-defined Group called [Menu]. Select it.
- The bottom pane called "Items in Group" is where you place any JW Lua script you want to show up in the menu. Click the "New" button and navigate to where you stored the script and add it to the list of items.
- Click "Close" to shut down the JW Lua plug-in. Restart Finale before the items will show up in the menu. BTW, the name that shows up is not the name of the script file, rather the name of the script stored in the file.
- If you wish, you can create sub-directories in the Finale plug-ins directory to sub-divide and categorize your JW Lua plug-ins. Otherwise any added scripts will be under the "JW Lua" directory.
Hope this helps.
"Anything is possible if you don't know what you are talking about!"
Windows 10 Professional (x64) (build 10586)
3.50 gigahertz Intel Core i7-5930K, Multi-core (6 total), Hyper-threaded (12 total)
32638 Megabytes Usable Installed Memory, 17514.37 Gigabytes Usable Hard Drive Capacity NVIDIA GeForce GTX 980 - 4GB [Display adapter]
ASUS Rampage V Extreme motherboard, Realtek HD Audio
Finale 2014.5.6359 Garritan GPO4.02
Cakewalk SONAR X3 - (X3e build 244) - x64, Sound Forge Audio Studio 10.0, Audacity 2.1.0 Sharpeye 2.68, PhotoScore Ultimate 7.0.2, SmartScore X2 Pro 10.5.8
"There is a world of difference between a person who has a big problem and a person who makes a problem big." – John Maxwell
| Back to Top | |
| mm Registered Member
Date Joined Mar 1999 Total Posts : 715 | Posted 8/6/2016 10:21 AM (GMT -6) | | Hi, Haven't installed the Lua plug-in yet. Just wondering, though - the script I've created in the normal Finale script manager with your script text - it does run something, but brings up the Measure Attributes screen. Couldn't that script be edited somehow so that it does what it's supposed to do? P.S.: The JW website doesn't seem to work ... opens only to a blank page...(?) Finale 3.7 - 2014.5, GPO4.02/5, Cubase, ProTools, ASUS laptop, Intel Core i5, 8GB RAM, WIN 8.1 (64-bit), 18.4'' display, M-Audio Keystation 49 + Mini 32 keyboardsPost Edited (mm) : 8/6/2016 10:29:50 AM (GMT-5) | Back to Top | |
| Motet Isorhythmic
Date Joined Dec 2002 Total Posts : 12849 | Posted 8/6/2016 11:26 AM (GMT -6) | | |
| Charles Lawrence Registered Member
Date Joined Dec 2009 Total Posts : 3638 | Posted 8/6/2016 12:07 PM (GMT -6) | | That's very strange! I get an internal server error 500. Something must be going on over across the big pond! I'm sure he is too busy with conversion to the new 64 bit Finale to fool with web sites at the moment.
Since JW is generous enough to supply these for free, I don't think he will mind if I post the JW Lua plug-in for your download until the site is back up and running.
https://www.dropbox.com/s/95yteki5azpu2g6/jwlua-beta-v0_45.zip?dl=0
And no, I have not adopted the new Help Center way of sharing files via DropBox. The zip is too big for the forum. And yes I am using Chrome at the moment.
"Anything is possible if you don't know what you are talking about!"
Windows 10 Professional (x64) (build 10586)
3.50 gigahertz Intel Core i7-5930K, Multi-core (6 total), Hyper-threaded (12 total)
32638 Megabytes Usable Installed Memory, 17514.37 Gigabytes Usable Hard Drive Capacity NVIDIA GeForce GTX 980 - 4GB [Display adapter]
ASUS Rampage V Extreme motherboard, Realtek HD Audio
Finale 2014.5.6359 Garritan GPO4.02
Cakewalk SONAR X3 - (X3e build 244) - x64, Sound Forge Audio Studio 10.0, Audacity 2.1.0 Sharpeye 2.68, PhotoScore Ultimate 7.0.2, SmartScore X2 Pro 10.5.8
"There is a world of difference between a person who has a big problem and a person who makes a problem big." – John MaxwellPost Edited (Charles Lawrence) : 8/6/2016 12:23:07 PM (GMT-5) | Back to Top | |
| mm Registered Member
Date Joined Mar 1999 Total Posts : 715 | Posted 8/6/2016 12:28 PM (GMT -6) | | Thanks for the link. Installed Luascript. However, running your script it shows me this error message: script Error while running JW Lua script: Finale 2014.5\Plug-ins\Luascript\measurecount.lua:1:unexpected symbol near '{' Finale 3.7 - 2014.5, GPO4.02/5, Cubase, ProTools, ASUS laptop, Intel Core i5, 8GB RAM, WIN 8.1 (64-bit), 18.4'' display, M-Audio Keystation 49 + Mini 32 keyboards | Back to Top | |
| Charles Lawrence Registered Member
Date Joined Dec 2009 Total Posts : 3638 | Posted 8/6/2016 12:39 PM (GMT -6) | |
mm,
Of course you should not be getting any error. The script works fine for me. Are you running the script from a menu selection as described above? You can also run the script from within the JW Lua plug-in. To do so
- Run the JW Lua plug-in.
- Click on the Development tab on the top.
- Click on the dropdown and choose open.
- Navigate to where you saved the download of my script, MeasureCount.lua. Select it and open. You should see the script text in the editor window.
- Click on the Run button. No error should occur. The script text is syntactically correct.
Let me know what you get. Try downloading the script file again. Post a screen shot of the development pane if there is an error.
BTW: There is no correlation between JW Lua scripts and Finalescripts. There is no telling what you might get if you try to run a JW Lua script as a Finalescript. I'm surprised anything worked!
"Anything is possible if you don't know what you are talking about!"
Windows 10 Professional (x64) (build 10586)
3.50 gigahertz Intel Core i7-5930K, Multi-core (6 total), Hyper-threaded (12 total)
32638 Megabytes Usable Installed Memory, 17514.37 Gigabytes Usable Hard Drive Capacity NVIDIA GeForce GTX 980 - 4GB [Display adapter]
ASUS Rampage V Extreme motherboard, Realtek HD Audio
Finale 2014.5.6359 Garritan GPO4.02
Cakewalk SONAR X3 - (X3e build 244) - x64, Sound Forge Audio Studio 10.0, Audacity 2.1.0 Sharpeye 2.68, PhotoScore Ultimate 7.0.2, SmartScore X2 Pro 10.5.8
"There is a world of difference between a person who has a big problem and a person who makes a problem big." – John MaxwellPost Edited (Charles Lawrence) : 8/6/2016 12:44:21 PM (GMT-5) | Back to Top | |
| mm Registered Member
Date Joined Mar 1999 Total Posts : 715 | Posted 8/6/2016 1:05 PM (GMT -6) | | Doesn't work, don't seem to be able to do/upload screen shot, but the problem is apparently (red mark on left) in the first line: {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
on the bottom it says: Running [Unnamed script] ======> [string "{\rtf1\ansi\ansicpg1252\deff0\nouicompat\defl..."]:1: unexpected symbol near '{' <======= [Unnamed script] FAILED. Finale 3.7 - 2014.5, GPO4.02/5, Cubase, ProTools, ASUS laptop, Intel Core i5, 8GB RAM, WIN 8.1 (64-bit), 18.4'' display, M-Audio Keystation 49 + Mini 32 keyboards | Back to Top | |
| Motet Isorhythmic
Date Joined Dec 2002 Total Posts : 12849 | Posted 8/6/2016 1:59 PM (GMT -6) | | |
| Charles Lawrence Registered Member
Date Joined Dec 2009 Total Posts : 3638 | Posted 8/6/2016 2:03 PM (GMT -6) | | mm,
None of that makes any sense to me. It is certainly not in the script. The script is not long, so I will put it here:
--------------------------------------------------------------
function plugindef() -- This function and the 'finaleplugin' namespace -- are both reserved for the plug-in definition. finaleplugin.Author = "Charles O. Lawrence" finaleplugin.Date = "8/5/16" return "MeasureCount", "MeasureCount", "" end
local musicRegion = finale.FCMusicRegion() local alertNeutral = finale.FCString() if finenv.Region():IsEmpty() then musicRegion:SetFullDocument() alertNeutral = "No selection made. Entire document chosen. Number of measures = " else musicRegion:SetCurrentSelection() alertNeutral = "Number of selected measures, including partial measures = " end
finenv.UI():alertNeutral(alertNeutral..musicRegion:CalcMeasureSpan()..".","Measure Count")
----------------------------------------------------
This is all that should be in the editor window. Try to copy/paste from here into the editor window. I was able to do it no problem. I'm really confused why you are getting anything like what you describe.
One thing that comes to mind. How did you install the JW Lua plug-in? You must unzip the files, then place all of them in the same Finale plug-ins directory.
"Anything is possible if you don't know what you are talking about!"
Windows 10 Professional (x64) (build 10586)
3.50 gigahertz Intel Core i7-5930K, Multi-core (6 total), Hyper-threaded (12 total)
32638 Megabytes Usable Installed Memory, 17514.37 Gigabytes Usable Hard Drive Capacity NVIDIA GeForce GTX 980 - 4GB [Display adapter]
ASUS Rampage V Extreme motherboard, Realtek HD Audio
Finale 2014.5.6359 Garritan GPO4.02
Cakewalk SONAR X3 - (X3e build 244) - x64, Sound Forge Audio Studio 10.0, Audacity 2.1.0 Sharpeye 2.68, PhotoScore Ultimate 7.0.2, SmartScore X2 Pro 10.5.8
"There is a world of difference between a person who has a big problem and a person who makes a problem big." – John Maxwell
| Back to Top | |
| mm Registered Member
Date Joined Mar 1999 Total Posts : 715 | Posted 8/6/2016 2:49 PM (GMT -6) | | No idea where all this came from. I redid the script with the info you listed, still doesn't work. I give up. Too much time being spent for a small improvement I was perfectly happy to use previously mentioned measure counting methods, although I did think that this script would have been a good and simple (and useful) script. Thanks for your efforts.
(later, since bugs me ...) P.S.: checked it again, here's what it says:
Running [MeasureCount] ======> ... (x86)\Finale 2014.5\Plug-ins\Luascript\MeasureCount.lua:17: attempt to call method 'alertNeutral' (a nil value) <======= [MeasureCount] FAILED. Finale 3.7 - 2014.5, GPO4.02/5, Cubase, ProTools, ASUS laptop, Intel Core i5, 8GB RAM, WIN 8.1 (64-bit), 18.4'' display, M-Audio Keystation 49 + Mini 32 keyboardsPost Edited (mm) : 8/6/2016 3:51:25 PM (GMT-5) | Back to Top | |
| Motet Isorhythmic
Date Joined Dec 2002 Total Posts : 12849 | Posted 8/6/2016 3:51 PM (GMT -6) | | The script works for me. I didn't try the Dropbox Lua plug-in, though--my guess is that's the problem.
The Development/open etc. business seems too cumbersome for something like this, though, where you want it to be quick (I like showing the info in the status bar when you select something). I guess there's a way to "install" Lua scripts and maybe assign them to hotkeys? Not only is it cumbersome, but if you open a Lua script the "Development" way, and after running it close the Lua window, there's no way to run it again without quitting Finale. If you reopen Lua, it thinks the script is open and gets confused. Finale 2014.5, 2011b, 2005, TGTools Windows 7, MIDI input Finale Transposition Chart | Back to Top | |
| Chuck Mayo Registered Member
Date Joined Aug 2014 Total Posts : 36 | Posted 8/6/2016 4:06 PM (GMT -6) | | I finally found a few minutes to play with this (busy, busy weekend), and had Charles' Lua script installed and working in Finale 2014 inside of five minutes. Very slick script, Charles! I'd never installed a Finale plug-in and this was the first time I'd heard of JW Lua, so your instructions helped a great deal. The dropbox Lua is fine, by the way.
Thanks also for the dropbox link to JW Lua, Charles, www.finaletips.nu has been down since you first posted the script so I had no clue where to get it.
In my case, I placed the contents of Charles' Lua script zip file (jwlua-beta-v0_45.zip) into my C:\Program Files (x86)\Finale 2014\Plug-ins\Miscellaneous directory.
Also placed Motet's MeasureCount.lua into the same directory.
opened Finale and loaded a score, JW Lua... was there and seemed to be functioning correctly.
Followed Charles' directions to hook MeasureCount.lua into the Lua script plug-in:
Run the JW Lua plug-in. Click on the Development tab on the top. Click on the dropdown and choose open. Navigate to where you saved the download of my script, MeasureCount.lua. Select it and open. You should see the script text in the editor window. Click on the Run button. No error should occur. The script text is syntactically correct.
Finally, restarted Finale and tested - MeasureCount is in my Plug-ins->Miscellaneous menu and works just fine.
Just to get all the pieces in one place:
JW Lua
url=https://www.dropbox.com/s/95yteki5azpu2g6/jwlua-beta-v0_45.zip?dl=0
Charles' measure count script is attached below.
ETA: Grrr.... cited the wrong author all through this post. Corrected now, I hope. Sorry about that, and thanks again, Charles! Finale 2007 Windows 7 64 Intel Core2 Quad CPU @ 2.66GhzPost Edited (Chuck Mayo) : 8/6/2016 4:40:39 PM (GMT-5)
File Attachment : MeasureCount.lua 1KB (application/octet-stream)This file has been downloaded 276 time(s). | Back to Top | |
| 45 posts in this thread. Viewing Page : 1 2 | Forum Information | Currently it is Tuesday, December 19, 2023 8:37 PM (GMT -6) There are a total of 403,820 posts in 58,165 threads. In the last 3 days there were 0 new threads and 0 reply posts. View Active Threads
|
Forum powered by dotNetBB v2.42EC SP3 dotNetBB © 2000-2023 |
|
|