I am looking for a way to insert a file into a document being edited.
I found the fileinsert macro but it doesn't seem to work, or most likely I am not using it correctly.
insert file
There are several ways you can do this.I am looking for a way to insert a file into a document being edited.
The first is to use the FileInsertAtCursor keyboard function which you can easily bind to any keyboard key combination.
Another option would be to write a custom macro script (like the file_insert macro).
I had a look at the macro and I think the issue is that the Lua io.open function has change between Lua versions.I found the file_insert macro but it doesn't seem to work, or most likely I am not using it correctly.
To fix this open the file_insert.lua file and find this text:
Code: Select all
-- open the file selected for text reading mode
local file_in = io.open(file_name, "r+t")
Code: Select all
-- open the file selected for text reading mode
local file_in = io.open(file_name, "r")
Thank you for taking the time to report the error in the script

Cheers Jussi