Last active
November 15, 2021 05:54
-
-
Save MattOstgard/31dd01530697c3ab9dea5fc8b7babc40 to your computer and use it in GitHub Desktop.
Create MaxScript .api file for use with the automcomplete feature of the MaxScript editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
Create MaxScript .api file for use with the automcomplete feature of the MaxScript editor. | |
Originally Created by: | |
James Haywood | |
http://apps.jhaywood.com/blog/ | |
Updated by Matt Ostgard | |
***/ | |
( | |
filteredSS = stringstream "" | |
ss = stringstream "" | |
apropos "" to:ss | |
seek ss 0 | |
while not eof ss do | |
( | |
l = readLine ss | |
if matchPattern l pattern:"*#struct:*" then | |
( | |
n = (filterString l " ")[1] | |
l = readLine ss | |
while matchPattern l pattern:"*public,*" do | |
( | |
format "%.%\n" n (trimLeft (filterString l ":")[1] " ") to:filteredSS | |
l = readLine ss | |
) | |
) | |
else if matchPattern l pattern:"*(const *" then | |
( | |
format "%\n" (filterString l " ")[1] to:filteredSS | |
) | |
) | |
filePath = (getDir #maxRoot) + "maxscript.api" | |
if (doesFileExist filePath) then ( | |
-- File exists so remove and create a fresh one | |
deleteFile filePath | |
) | |
fStream = createFile filePath | |
format "%" (filteredSS as string) to:fStream | |
close fStream | |
edit filePath | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Matt, nice script :-)
I made some changes for Notepad++ as XML
[CODE]
fn generateNotepadApi = (
)
generateNotepadApi()
[/CODE]
MerlinEl 2019