[JW Lua] AssureFileExtension()

Thomas Weber thomas.weber at notengrafik.com
Fri Aug 5 17:17:02 CEST 2016


The documentation for AssureFileExtension() says:

  Makes sure that a file extension exists for the file name. If one is missing, the suffix is added.
  http://www.finaletips.nu/frameworkref/class_____f_c_file_dialog_base.html#a3fac5e0a89db68cf6d46feb0ec22836e

However, this sample code does not add an extension if I input something that has no extension:

  local dialog = finale.FCFileSaveAsDialog(finenv.UI())
  dialog:AssureFileExtension ".txt"
  dialog:Execute()
  local fileName = finale.FCString()
  dialg:GetFileName(fileName)
  print(fileName.LuaString)

It pre-fills the file name field with the extension, but that's not what I'd expect from the documentation.  Is this a bug or just misleading documentation?

Thomas



More information about the JWLua mailing list