Skip to content

Plugin for StrokesPlus.net to extend and enhance the scripting capabities within actions and hotkeys

License

Notifications You must be signed in to change notification settings

spcsp/scripts-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

625fd9e · Jul 25, 2021
Jul 25, 2021
Jul 25, 2021
Jul 25, 2021
Feb 9, 2021
Feb 3, 2021
Nov 10, 2020
Jul 25, 2021
Mar 2, 2021
Feb 25, 2021
Jul 25, 2021
Feb 26, 2021
Nov 10, 2020
Jul 25, 2021
Feb 25, 2021
Jul 25, 2021
Feb 25, 2021
Jul 25, 2021

Repository files navigation

@spcsp/scripts-plus

Enhance the scripting capabilities of S+ with a rich module library.

Inspired by the simplicity of jQuery, there are 40+ modules that extend and enhance the scripting capabilities within action scripts. Many common sp.xxxx methods are wrapped to simplify their use and some wrapped together to create new tools.

Install

Open the S+ console and in the script tab & paste this command

SPPM.Install("@spcsp/scripts-plus");

and click ▶ Execute

Usage

Open the main interface of StrokesPlus

  • Head to Global Actions
  • Open the Load/Unload tab
  • Check the box to enable the load script
  • Paste in this snippet: var $ = ScriptsPlus();
  • Now $.xxx methods are available in any script context

Examples

Wrapped Methods

// wraps `sp.MessageBox()`
$.alert("Hello World!");

// wraps `new DisplayTextInfo()`
$.toast("Hello World!");

// wraps `sp.sp.ShowBalloonTip()`
$.balloon("Hello World!");

Dialogs

function getUserInput() {
  var modal = $.dialog.create("Text Input Demo");

  modal.show(input => $.alert(input, "Input"));
}

getUserInput();

Popup Menus

var { addToMenu, addToSubMenu, menuItem, show } = $.popup;

var popup = $.popup.create();
var addToMainMenu = $.popup.addToMenu(popup);

var mastercam = menuItem("Mastercam");
var addToDemo = $.popup.addToSubMenu(mastercam);

addToDemo(menuItem("Hello World", `$.alert('Hello World')`));
addToDemo(menuItem("Taco Bell", `$.alert('Taco Bell')`));
addToDemo(menuItem("Is Good", `$.alert('Is Good')`));

addToMainMenu(mastercam);
addToMainMenu($.popup.spacer);
addToMainMenu($.popup.cancel);

show(popup);

About

Plugin for StrokesPlus.net to extend and enhance the scripting capabities within actions and hotkeys

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published