Scripting issue

General notation questions, including advanced notation, formatting, etc., go here.

Moderators: Peter Thomsen, miker

User avatar
ICBSprod 22-12
Posts: 21
Joined: Mon Feb 17, 2020 6:24 pm
Finale Version: 27
Operating System: Windows

Post by ICBSprod 22-12 » Wed May 31, 2023 6:41 am

Hello!
I want to change the values for the systems top margins in a lot of documents.
How do I distinguish between the systems I want to affect?
Example: I want the first systems top margin to be 150 points, and the rest (2 thru 0) to be 20.
I am only able to affect all.

«System Top margin 150» sets top margins to 150 for all systems. The minute I put in a number after system, it becomes the value for the margin.
«System 1 Top margin 150» Results in top margin for all system to become 1, and the rest of the script is ignored.

Please help.
Børge
Norway
Norway - Win10 - Finale user since 3.7 - now on 27 - SmartScore 64 Pro


bakkumd
Posts: 79
Joined: Thu Feb 27, 2020 12:25 am
Finale Version: 25, 26, 27
Operating System: Mac

Post by bakkumd » Wed May 31, 2023 1:48 pm

ICBSprod 22-12,

Try this:

Code: Select all

Highlight System 1
System Top Margin 150 Points
If there is no selected region/system, Finalescript defaults to all systems in the displayed score or part.
Finale 25, 26, 27, Patterson Plug-ins, JW Plug-ins, TG Tools, Perfect Layout Gold, Keyboard Maestro, Adobe CS6 - CC, MacOS Mojave through Monterey. NotePerformer 3, Dorico 4, Sibelius Ultimate.

User avatar
ICBSprod 22-12
Posts: 21
Joined: Mon Feb 17, 2020 6:24 pm
Finale Version: 27
Operating System: Windows

Post by ICBSprod 22-12 » Thu Jun 01, 2023 4:52 am

Excellent!!
Now I'm finally getting somewhere.
For the rest of the systems: Do I have to set up one line for each system? Some documents have only 3, and others have up to 15.
Then I will need 15 entries. That seems unnecessary...
Is there a way define System 2 to the end? I have tried different solutions and combinations, but so far with no luck.
Norway - Win10 - Finale user since 3.7 - now on 27 - SmartScore 64 Pro

bakkumd
Posts: 79
Joined: Thu Feb 27, 2020 12:25 am
Finale Version: 25, 26, 27
Operating System: Mac

Post by bakkumd » Thu Jun 01, 2023 1:40 pm

You can set a specific range of systems to use :

Code: Select all

Highlight Systems 2 to 5
System Top margin 150 Points
Here is a link to the Finale help page that shows all FinaleScript commands with examples. Click on the "Expand All" button in the upper right of the page to expand all topics. Then you can search the page for key words and find out if a command exists for what you want to do: http://usermanuals.finalemusic.com/Fina ... references.

I occasionally find some FinaleScript actions inconsistent in their behavior. Unfortunately, there isn't much additional documentation in the Finale Help pages.
Finale 25, 26, 27, Patterson Plug-ins, JW Plug-ins, TG Tools, Perfect Layout Gold, Keyboard Maestro, Adobe CS6 - CC, MacOS Mojave through Monterey. NotePerformer 3, Dorico 4, Sibelius Ultimate.

User avatar
ICBSprod 22-12
Posts: 21
Joined: Mon Feb 17, 2020 6:24 pm
Finale Version: 27
Operating System: Windows

Post by ICBSprod 22-12 » Sat Jun 03, 2023 5:26 am

Thanks for helping!

«Highlight Systems 2 to 5» will only work if there are 5 systems in total. I have already tried that one out (if I am not missing something out here) That means that I have to change the script for every document as long as the documents contain different numbers of staffs. What I really was asking for was if there were a way to tell Finale that when the first staffs settings is set correct, now I want to treat the rest of the staffs combined; staff 2 to the end, no matter how many staffs the document contains.

I have read the Finale help menu, the basics are treated there, but when it comes to details, how to access specific tasks, not much help is found... As in this situation, the one little word i couldn't figure out for myself, was the word "Highlight". So the best way to get any further is to send out a help message on the forum to see if anyone else has the answer.
I am "sort of" familiar with scripting using the Finales interface (I am using that a lot - I could call the Edit Margins popup, and tell Finale to type 2 in the text box near Change system, and type 0 in the text box near Thru....and so on...), but it is more conveniant to give commands directly. Finale performs the tasks much faster this way. But here I am still struggling to climb up to the level of a "Novise".. sorry.

So I appreciate all help You can provide.
Norway - Win10 - Finale user since 3.7 - now on 27 - SmartScore 64 Pro

bakkumd
Posts: 79
Joined: Thu Feb 27, 2020 12:25 am
Finale Version: 25, 26, 27
Operating System: Mac

Post by bakkumd » Sat Jun 03, 2023 3:23 pm

Try this:

Code: Select all

Highlight Systems 2 to end
System Top margin 20 Points
Here is a screenshot of the examples from the manual in the link I offered above:

Selecting systems.png
If "Highlight" doesn't work, use "select" or "sel" as indicated in the screenshot.

There are also keyboard shortcuts that will manually extend your selection to the end of the piece. Select the first measure of the region you wish to edit using the selection tool, then type SHIFT + END. This will extend your selection to the end of the document - past the visible page(s). You could then run your single action of "System Top margin 20 Points", save and move to the next file.

On a Mac, I use Keyboard Maestro to automate batch processing. I do not know of a Windows equivalent, but I am assuming it exists. Maybe a Windows user can offer an option for automating batch processing tasks...

I tried this in FinaleScript and it opened, processed, and saved 50+ files in under 5 minutes. You will need to click "OK" on an occasional warning dialog box that might pop up as the script works through each file, especially if any files have not been previously saved in F27:

Code: Select all

batch process folder and subfolders

select system 1
System Top margin 150 points

select systems 2 to end
System Top margin 20 points

Save
Close
When you run this script, Finale will first ask you to select the folder containing the files you want to process. If you don't want Finale to process files within any subfolders inside your designated folder, just delete "and subfolders" from the script. You do not need to have any files open in Finale to run this script.
Finale 25, 26, 27, Patterson Plug-ins, JW Plug-ins, TG Tools, Perfect Layout Gold, Keyboard Maestro, Adobe CS6 - CC, MacOS Mojave through Monterey. NotePerformer 3, Dorico 4, Sibelius Ultimate.

Post Reply