insert file

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
G74SX
Posts: 8
Joined: Thu Mar 14, 2013 9:56 pm

insert file

Post by G74SX »

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.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

I am looking for a way to insert a file into a document being edited.
There are several ways you can do this.

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 found the file_insert macro but it doesn't seem to work, or most likely I am not using it correctly.
I had a look at the macro and I think the issue is that the Lua io.open function has change between Lua versions.

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")
Change that code to read as follows:

Code: Select all

-- open the file selected for text reading mode
local file_in = io.open(file_name, "r")
The macro should now work fine.

Thank you for taking the time to report the error in the script :)

Cheers Jussi
G74SX
Posts: 8
Joined: Thu Mar 14, 2013 9:56 pm

Post by G74SX »

The keyboard function works great.

Thanks.
polixx
Posts: 1
Joined: Mon May 06, 2013 4:09 pm

Post by polixx »

I tried using the option one which is FileInsertAtCursor keyboard function and yes it really works! thanks for the inputs.
Post Reply