I would think more of something like, reading the UDF file and append the UDFs to your keyword/ macro list

Then when you save the file, it will append the 'used' udfs to the end of the file automatically.

If you use Kixforms designer, the app only modifies the code between the 2 custom tags that it inserts... make something like that where it inserts the used UDFS between custom tags that it inserts at the end of the script

; ************ [Library UDFs begin] ************
Function ...
EndFunction

Function ...
EndFunction
; ************ [Library UDFs end] ************
_________________________
How to ask questions the smart way <-----------> Before you ask