User Tools

Site Tools


jwlua:development

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
jwlua:development [2014/08/26 06:55]
jariw [The 'plugindef()' function]
jwlua:development [2015/04/17 09:58]
jariw [The 'finenv' namespace]
Line 51: Line 51:
 | finenv.UI() ​   | Returns the global "user interface"​ object (of the FCUI class). The FCUI class contains Finale and system-global tasks, such as displaying alert boxes, sounding a system beep, or getting the width of the screen, etc. |  | finenv.UI() ​   | Returns the global "user interface"​ object (of the FCUI class). The FCUI class contains Finale and system-global tasks, such as displaying alert boxes, sounding a system beep, or getting the width of the screen, etc. | 
 | finenv.UserValueInput() ​ | Creates and returns a dialog object to be used for [[jwlua:​uservalueinput|simple user input]]. | | finenv.UserValueInput() ​ | Creates and returns a dialog object to be used for [[jwlua:​uservalueinput|simple user input]]. |
 +| finenv.StartNewUndoBlock() | Ends the currently active Undo/Redo block in Finale and starts a new one with a new name. First parameter (a Lua string) is the name of the new Undo/Redo block. Second parameter (optional, default is ''​true''​) is a boolean, indicating if the edits in the previous Undo/Redo block should be stored (=true) or cancelled (=false). Finale will only store Undo/Redo blocks that contains edit changes to the documents. Available in beta 0.36 and above. |
 | finenv.FinaleVersion | A read-only property with the running Finale "​year"​ version, such as 2011, 2012, etc. | | finenv.FinaleVersion | A read-only property with the running Finale "​year"​ version, such as 2011, 2012, etc. |
 | finenv.RawFinaleVersion | A read-only property with the full Finale version number. It's constructed as 4 bytes with different version info. The highest byte is the major version, the next is subversion, etc. Use this only if you need the revision number of a specific major Finale version. | | finenv.RawFinaleVersion | A read-only property with the full Finale version number. It's constructed as 4 bytes with different version info. The highest byte is the major version, the next is subversion, etc. Use this only if you need the revision number of a specific major Finale version. |
Line 56: Line 57:
 | finenv.MinorVersion | A read-only property with the minor version number of JW Lua. A version 1.07 would give 7, etc. | | finenv.MinorVersion | A read-only property with the minor version number of JW Lua. A version 1.07 would give 7, etc. |
 | finenv.StringVersion | A read-only property with the full "​printed"​ version number of JW Lua, as a string. | | finenv.StringVersion | A read-only property with the full "​printed"​ version number of JW Lua, as a string. |
 +| finenv.ConsoleIsAvailable | A read-only property that will return true if there'​s a console available for ''​print()''​ statements. Scripts that runs from the Finale menu don't have a console. Available in beta v0.28 and above. |
  
  
Line 188: Line 190:
 allpages:​LoadAll() allpages:​LoadAll()
 for v in each(allpages) do for v in each(allpages) do
 +     print ("​Page",​ v.ItemNo, "has the width",​ v.Width)
 +end</​code>​
 +
 +==== eachbackwards() ====
 +
 +''​eachbackwards()''​ does the same as the ''​each()''​ iterator, but parses the elements backwards starting from the end of the collection. It feeds the ''​for''​ loop with all the elements of the collection. This iterator is available in beta version 0.31 and later.
 +
 +<code lua>-- Print the widths for all the pages, starting from the last page
 +allpages = finale.FCPages()
 +allpages:​LoadAll()
 +for v in eachbackwards(allpages) do
      print ("​Page",​ v.ItemNo, "has the width",​ v.Width)      print ("​Page",​ v.ItemNo, "has the width",​ v.Width)
 end</​code>​ end</​code>​
Line 193: Line 206:
 ==== eachentry() ==== ==== eachentry() ====
  
-''​eachentry()''​ feeds a ''​for''​ loop with all the note entry objects in a region, without saving them back.+''​eachentry()''​ feeds a ''​for''​ loop with all the note entry objects in a region, without saving them back. Mirror entries are processed with ''​eachentry()''​.
  
 First parameter to this function is the region to process, where you could use ''​finenv.Region()''​ to get the current selection. First parameter to this function is the region to process, where you could use ''​finenv.Region()''​ to get the current selection.
Line 217: Line 230:
 ==== eachentrysaved() ==== ==== eachentrysaved() ====
  
-''​eachentrysaved()''​ feeds a ''​for''​ loop with all the note entry objects in a region and automatically saves the entries back to Finale after processing. Only use this function when the entries actually needs to be saved. It requires the same parameter(s) as ''​eachentry()''​ (see above).+''​eachentrysaved()''​ feeds a ''​for''​ loop with all the note entry objects in a region and automatically saves the entries back to Finale after processing. Only use this function when the entries actually needs to be saved. It requires the same parameter(s) as ''​eachentry()''​ (see above). Mirror entries are __not__ processed with ''​eachentrysaved()''​.
  
 One other task that can be automatically done with ''​eachentrysaved()''​ is to delete entries. Just set the duration to 0, and ''​eachentrysaved()''​ will automatically delete the entry prior to saving it. One other task that can be automatically done with ''​eachentrysaved()''​ is to delete entries. Just set the duration to 0, and ''​eachentrysaved()''​ will automatically delete the entry prior to saving it.
jwlua/development.txt ยท Last modified: 2015/04/17 09:59 by jariw