The import and export feature, while functional at the moment, is still being developed and may undergo some changes in the future. This guide will be updated to reflect any of those changes as they occur.
Thanks to the work done by Aeyr, Nexus is now capable of importing and exporting scripts - a great feature that allows us all to easily share scripts, import and export whole systems, and help others debug their scripts, and work on our systems off-line. But how does it all work? This guide breaks it all down, step by step.
Importing Scripts in Nexus
1) Open the file that has the script/system you want to import. It's preferrable that you open the script in a plain text editor (for Windows users, that would be Notepad - click Start > Run > type in Notepad, and press enter.) Then press File -> Open and search for the file you want to import. After you find it, select it and press the 'Open' button. Now, this is a very important part - Word Wrap must be disabled, because it will mess the script up if it's on. Click the 'Format' button at the top of the Notepad window, and make sure that the Word Wrap option is not checked. If it is checked, click on it to uncheck it.
*
Mac people need to use Word for this, and select the 'Text Only' option when saving.
2) After you open the file, press Ctrl+A and then Ctrl+C. This will select everything and copy it.
3) Now, head over to Nexus, and open the Reflex Editor (click the second blue button on your left). Click the 'Archives...' on the top-right in the window that shows up, and then click the 'Import XML' button that's at the bottom.

4) The 'Import XML' button will give you another window - press Ctrl+V to paste the settings you want to import. Click 'Save' that's at the bottom of the window.

5) You'll now be presented with three options on how to import - by default, choose the merge button unless the instructions for importing a script tell you otherwise. The merge option will keep all your current settings and just import the script.
You may receive an error regarding non-ASCII characters. It is safe to ignore this warning and continue with the saving and importing process.

6) Click the 'OK' button after the script is imported, and you're all set to use it!
Exporting Scripts in Nexus
Exporting in Nexus is just as easy as importing - just push a few right buttons, and you're done. To find out which buttons and in what order, read below:
1) Open the Settings Editor - click the second blue button on your left in the main Nexus screen. Then, click the 'Archives...' button on the top-right.

2) Now, select the 'Export XML' button at the bottom. A window will show up containing all your settings - copy all of that (press Ctrl+A, Ctrl+V), and paste into a plain-text editor (like Notepad in Windows - read the first item in the Import section for instructions on using Notepad. Make sure that Word Wrap is disabled also.)


3) Save the file with a .txt suffix, and share it with whoever you need to!
Transferring Scripts
Scripts should generally be saved and transferred as plain .txt files, so that they can be easily copied and imported into Nexus.
Hotmail and Yahoo:
Hotmail and Yahoo automatically make some changes to text files when they are being sent from those email addresses, rendering the files unusable. Trying to avoid this by using other filetypes causes additional problems.
If you ever need to transfer an exported system file by email, don't use Hotmail or Yahoo. Try Gmail - which is a free email service that does not make changes to files when they are sent - or use AOL, or your own personal ISP email address instead. Most of the time those addresses send files without any trouble.
Understanding Nexus' XML
Nexus uses the XML language as a medium for importing and exporting reflexes. If you don't know what XML is, here is a quick overview - XML stands for eXtensible Markup Language, and its structure is generally made up of nested tags - much the same way as Nexus stores it's settings. Objects in XML are called tags, and each tag can also have it's own attribute - which are adjectives that describe it. Whenever a tag is opened, everything will go inside it until the tag is closed. To make it easier to understand, think of tags as brackets - everything goes into an open bracket much like everything goes into an open tag. To compare this with how Nexus stores settings, think of this: all of your Nexus settings are at large stored in an archive - this archive contains all your groups. Next, all these groups inside them contain variables, aliases, triggers, and keybindings. And inside each alias, trigger, and keybinding is it's own respective script (and data for variables). This translates easily into XML - your whole archive is called a reflexbundle, inside which go all your groups, and inside the groups go all your settings.
The syntax for an opening tag is the following:
<tag_type attributes="values for attributes">
Note that the tag type must be one word, that's why it has an underscore in it. Attributes are also optional, but if they are used, all the values for the attributes go inside the quotes.
After a tag is opened, like a bracket, everything will go inside it. To close a tag, you simply do
</tag_type>.
To put this into an example, let's say I have an alias which is named "test", and its script is "hello". The proper Nexus XML code for it would be <alias name="test">hello</alias>. We at first started off stating the tag type (alias), then the name attribute and its value (test), and then we put "hello" inside the tag, and closed it with the corresponding tag type (</alias>).
All the possible tags and attributes for Nexus' XML are summarized in the table below:
| Tag Type |
Tag Attributes |
Value |
| reflexbundle |
modified, author |
all groups go inside this tag. |
| group |
name, disabled* |
variables, aliases, triggers, and keybindings go inside groups. |
| var |
name |
variable data. |
| alias |
name |
alias script. |
| trig |
name |
trigger script |
| keybinding |
name |
keybinding script. |
Now, to expain each tag. The 'modified' and the 'author' attributes of the reflexbundle tag are only used for information purposes only; Nexus doesn't use them if you import a script. The 'name' attribute of the group tag is the group's name. For examle, for the default group, the tag would be <group name="default">, and this is the same for variables, aliases, triggers, and keybindings also. The 'disabled' attribute of the group tag tells the groups status, if the group is disabled, it's value will be 1 (for example - <group name="test" disabled="1"> would mean that the test group is turned off).
As explained above, the basic structure of your Nexus settings can be put as this:
Your archive
All your groups, which are inside the archive.
All your variables, aliases, triggers, and keybindings, which go inside each group. So let's say my whole system consists of two groups, with two aliases in each. The two groups would be group1 and group2, and aliases would be alias1 to alias4, each one doing a diffent greeting. To put it in a structure, they'd go like this:
My archive. group1 alias1: hi alias2: hello group2 alias3: greet alias4: hey Pretty simple? Now, to put this into XML:
<reflexbundle> <group name="group1"> <alias name="alias1">hi</alias> <alias name="alias2">hello</alias> </group> <group name="group2"> <alias name="alias3">greet</alias> <alias name="alias4">hey</alias> </reflexbundle> Notice how tag was properly closed with </tag_type>, and each "nesting" was indented by 2 spaces, to make it easier to read.
Now, there are a few things you should be aware of when using XML, and that is that some characters need to be converted before they can be used. The complete conversion table for them is below:
| Character |
How it should look like in XML |
| < |
< |
| > |
> |
| " |
" |
| & |
& |
You only need to convert these characters if you're using them inside a script. For example, if I have an alias "test2" that does say hey "bob" & mike!, the proper XML code for it would be the following: <alias name="test2">say hey "bob" & mike!</alias>.
Nexus also has several options for importing xml files - update, merge, and restore. The update option will leave all other settings intact, and only import new ones. The merge option is much more useful - it not only leaves the other settings, and import new ones, but it will also update the values/scripts of the existing ones. That is why the merge option is recommended for importing scripts. And the last option, restore, will wipe all previous settings, and import the new ones.
Known Bugs and Quirks
When using XML scripting, there is a DISABLED attribute for the GROUP tag-type (shown in the above table), however this attribute is not parsed by the client. Trying to use the attribute in XML scripts will not turn a group off. Instead, the built-in #groupoff function in Nexus can be used either within the script itself, or entered manually by the user from the command prompt.
Tips and Tricks for Nexus' XML
A few tips to help streamline your scripts:
- create the variables yourself (i.e. don't let Nexus auto-create them all in the default group)
- avoid using the default group for anything - it should be left as the user's group for good organization
- the indent is two spaces, so stick to that
Nexus' new function offers much more than just importing and exporting, and for the advanced user, below are outlined some of the most useful ones:
- ability to place variables into groups you choose; not just the default group if you're relying on Nexus' auto-create of variables.
- ability to work offline on your scripts and systems.
- ability to wipe everything (by importing only a reflexbundle tag with a default group tag inside it).
- when you're converting a script to xml, make sure the first thing you do is convert all characters (using the table outlined above).
- get an XML-compatible text editor to ease your job when working with Nexus XML. Notepad++ is a good one for Windows users.
- thank Aeyr for implementing the Import and Export feature.
And above all, enjoy using Nexus!
Documentation written by Vadi.
(back to guides) |