From the command line,
subl -a <somedir> will add
<somedir> to the current window whether or not that window contains a project, while from within Sublime
Project > Add Folder to Project does the same thing (but
File > Open Folder opens it in a new window).
Note that although this appears to be project related, it works even in windows without an associated project. A good way to look at this is that every window has some sort of inherent project-like information associated with it, but not all windows have that data persisted to disk in a
To do something like this from the context menu of a file explorer or such, you need to know how to make your OS run a different command than it's using currently, but you can take advantage of the same command line parameter as above to pull this off.
Macros can only contain
TextCommand commands, which are commands that directly modify the state of a buffer (contents or selections). As such although you can in fact hand modify a macro (and I tend to just create mine that way directly), if you put any other commands in there they will be ignored.
That said, with the plugin system depending on what it is you want to do you can perhaps create a TextCommand that takes whatever actions you want to take, such as manually invoking commands that would otherwise be inaccessible.
Some things, such as Find and Replace, don't have explicit commands (except to open or hide the panel), so for something like that you may want to look at RegReplace/
A better reference to the command list is available in the Unofficial Documentation. You can also look at things like the default key bindings or use
sublime.log_commands(True) in the console to see what commands exist or what commands bound to keys and menu items do.
One way is to open the Sublime console with
View > Show Console and then enter
sublime.log_commands(True). This makes Sublime log commands as it executes them, so if you press a key and you see output you know that it's currently doing something. Additionally you can also look at the default key bindings to see what is available; when you select
Preferences > Key Bindings from the menu, the left pane in the window is the default bindings for your platform.
Any bindings you make in your User bindings (the right hand pane in the above window) supercede all other bindings that might appear on that key, so you can more or less rebind things with impunity. In such a case you may remove default bindings to commands, but you can always get at them from the menu or the command palette (or add them there if they're missing) as well as binding them to other more friendly keys.