Visual Studio Code: Cannot run background script (command not available)

Sebastian R_
Kilo Sage

I have setup one of my custom appplications in VS and wanted to run a fix script as background script but the command is not showing up for me.

Can anyone help me with it?

find_real_file.png

1 ACCEPTED SOLUTION

Shiva22
ServiceNow Employee
ServiceNow Employee

The "background script" feature can be found in the contextual menu, when you do a right-click after you select a particular piece of code you want to execute in a Javascript file. Only the lines of code selected (or) highlighted will be executed.

You have the option to run the selected code in the 'Current' scope or the 'Global' scope. 

The results are returned right back to the editor. 

find_real_file.png

View solution in original post

5 REPLIES 5

Shasank
ServiceNow Employee
ServiceNow Employee

The command is not available in the Command Palette but only in the context menu when you select text in a js file.

This shall be rectified in the documentation.