Please share your AutoHotKey macros for Scrivener

In order to split and retain metadata, I have mapped the Windows-z (hold down Windows key, press z) to split a document and retain the metadata using this AutoHotKey script, which only works when the AutoHotKey script is running and the Scrivener window is active:

SPLIT, ADD “.1” TO TITLE

#IfWinActive ahk_class QWidget
#z::
SendInput ^+{End}^x^+d{End}.1{Enter}^{Tab}^a^v
return


SPLIT, MAKE SELECTED TEXT TITLE

This requires you to select text in the created split document, which I’ll call the “child” document. After splitting, select the text and then use this script, which I have mapped to Windows-a (hold down Windows key, press a):

#IfWinActive ahk_class QWidget
#a::
SendInput ^c^{Tab}{F2}^v{Enter}^{Tab}{Right}{Left}
return

NOTE: If you change the initial ^c to ^x it will cut the text from the document before placing it as the title. In that case, remove the {Right}{Left} from the end, as they are superfluous.