A downloadable plugin

Quick links: Source code

This GMEdit plugin allows to quickly create scripts right from the code editor - hit a keyboard shortcut (default: Ctrl+N), enter a script name, and it will be created next to the currently open script.

You can also select some text and press the shortcut to use that name.

You can also right-click a resource tree folder and pick `Create > Create here` to create scripts in that directory.

If used in conjunction with Peek Aside, the new script will be opened in a side-view.

Download

Download
quick, make script.zip 1.5 kB

Install instructions

Unzip into a new directory in your Plugins directory.

Comments

Log in with itch.io to leave a comment.

(1 edit)

Thanks for GMEdit, it's breathed new life into GameMaker development.

Just wondered about this plugin as I can't get it to work when highlighting text. I get the error message asking to choose Create Here, yet that option is greyed out in the tree view. Maybe I'm doing something wrong?

Version: GMEdit-Mac, 6 Sep 2023

Fixed that - due to project structure changes the old way I detected whether a directory may contain scripts no longer worked.

Ah amazing thank you! I pulled the latest and reloaded GMEdit and it works great.

I did initially try the "reload" link for the plugin in Preferences, but it just brings up a blank white window and nothing happens. Might be an Electron problem?

One thing I did notice is I cannot close the Aside that comes up (via Peek Aside) after creating the script, as there is no Hide Aside option in the right-click menu as there usually is. Worked around it by closing the tab for the script. Normal Asides can be hidden fine.

“reload” is supposed to unload-load the plugin (it does not check for updates), but this plugin does not implement that correctly. It would take a few paragraphs to explain how that ends up opening a popup window.

Peek Aside’s asides do not have a context menu entry - they are closed by pressing Esc while they are focused.

(1 edit)

Yeah that's what I'd expect reload to do but it's no biggie :)

Is Peek Aside different from the Show aside context menu option? Those can't be closed by Esc but do have a Hide aside context menu option. Maybe I misunderstood that this was different from what this plugin uses.

Looking at the shortcuts for Peek Aside it seems they don't work on Mac. Alt + F1 (Opt + F1 on mac) opens the Displays part of my Preferences application instead. I have been using the context menu this whole time, but perhaps that's different. I expect this belongs as a comment under that plugin - sorry for getting off-topic.

Esc works for this plugin's version of Aside though so thanks for that! All sorted.

Edit: Ah yes I see it's show-aside that's adding the context menu.

Peek Aside is separate from Show Aside - its usual function is to open a resource for quick inspection, kind of like “Peek Definition” works in other editors or how Inspector now works in GM IDE.

You can change the keyboard shortcut in preferencesю

it can't be used

disabled create here

If I don't pick a directory for scripts to be created in before trying to create a new script with Ctrl+N from within an object, I get a popup saying "Can't create a script next to this resource" (why not just default to the root script folder?), and then after dismissing the popup I can't type any code for some reason, until I restart GMEdit 🤔

Using latest GMEdit stable (May 6, 2020), GMS 2.2.5

"not being able to type code" is an Electron bug related to plugin using alert() instead of much longer-winded electron->Dialog->showMessageBox. It resolves by clicking away from the window and then back, but I should probably replace window.alert with that.

Dumping scripts into root folder seemed undesirable, but maybe less undesirable than not making scripts at all? Who knows

Good to know not being able to type can be fixed that easily, in hindsight I'm surprised I never tried clicking off and back on the window!

And yeah, I'd definitely prefer it creating the script in the root folder than not at all, feels less "punishing" and more similar to the GMS2 IDE as well (Alt+C creating a script in root)