finale-lua / lua-scripts

A central repository for all Lua scripts for Finale.
https://finalelua.com
Creative Commons Zero v1.0 Universal
15 stars 14 forks source link

Update to "ties_remove_dangling" #683

Closed jwink75 closed 8 months ago

jwink75 commented 8 months ago

Added menu option to replace removed ties with slurs

asherber commented 8 months ago

Why make this work only on the full document, instead of letting the user select a region?

jwink75 commented 8 months ago

Well, only because that’s what I wanted it to do when I wrote it :) I can definitely see the utility in that though so let me address it

asherber commented 8 months ago

(Of course the script can do whatever you want it to do. It's just that the current version works on the selected region, so this would be a breaking change.)

jwink75 commented 8 months ago

I submitted a version last night that works on the current selection, but if there is no selection puts up an AlertYesNo asking if you want to process the whole thing… I think this is the best if both worlds solution!

asherber commented 8 months ago

Your solution is fine. Just FYI, some scripts use a library function called get_selected_region_or_whole_doc() (docs here) to do this transparently -- run the plugin over a selection if there is one, else over the whole doc.

jwink75 commented 8 months ago

That’s good to know, I will use that in the future. My first thought was to do that but then thought that maybe the prompt would be helpful? I could certainly take the alert window out too…

asherber commented 8 months ago

IMO, either way is fine. I think we have scripts that take both approaches.

jwink75 commented 8 months ago

Then I think let’s leave with the current iteration. I feel like when I know it’s going to process the whole document (like it used to) I don’t need/want a reminder, but now that the ability to be selective is there it’s often nice to get the reminder (especially with destructive edits!)

asherber commented 8 months ago

I feel like when I know it’s going to process the whole document (like it used to)

Just to be clear, the version of the script currently available in the repo works on the selected region. Processing the whole document is the new functionality.

jwink75 commented 8 months ago

Did it not update? Man, I hate Github. I'll try to figure out why in a moment - I swear I uploaded a fixed version last night.

asherber commented 8 months ago

Your pull request has the new functionality. What I'm saying is that on https://finalelua.com today, the script operates on the selected region. Your pull request is adding the "whole document" functionality.

jwink75 commented 8 months ago

Ah! Oh good! Yes, that is right, or at least partially right. This adds two things:

  1. An additional menu item that offers the ability to replace any deleted dangling ties with slurs. Before it only removed them.
  2. Works on selected region, and prompts the user to process the whole document if no region is selected.

Thanks Aaron!

rpatters1 commented 8 months ago

Personally I hate question dialogs. Hitting Undo is much less disruptive than a dialog. ymmv, but that's why I created the library function.

jwink75 commented 8 months ago

Fair enough… I’ll go ahead and remove the dialog. Nicer for the way I want to use it most of the time anyway :)