Sample scripts for script-caster app.
Copy of Exterior.
-
GET_LOCATION.pyw
Gets IP location of target machine and writes information to Exterior. -
UPLOAD_SCREENSHOT.pyw
Takes a screenshot of the target machine and uploads it to a Google Drive folder. -
STAY_AWAKE.pyw
Forces computer to not go to sleep by pressing the F15 key every 60 seconds. -
PIP_PACKAGE.pyw
Installs/updates/uninstalls pip packages. Useful if you're creating a python script using pip modules which are currently not installed on the target computer. The package name is inputted in Exterior. -
AlERT_BOX.pyw
Creates an alert box. You can input the title and text in Exterior. -
EXECUTE_LINE.pyw
Executes a line of code. You can input the line in Exterior. -
NEXT_VIRTUAL_DESKTOP.pyw & PREVIOUS_VIRTUAL_DESKTOP.pyw
Moves to subsequent/previous virtual desktop.
Scripts often need to interact with Exterior and Google Drive. To do so, the files lib/exterior_connection.py
and lib/gdrive_pyinteract.py
can be imported. Examples of their usage can be found in UPLOAD_SCREENSHOT.pyw
, GET_LOCATION.pyw
and a few others. You can also find more details on lib/gdrive_pyinteract.py
in this repository.
- It downloads the all the files in this repository into a folder of your choice. You can set the folder path in Settings (Visible in app GUI).
- It checks Exterior for the switch for the script.
- If the switch is enabled, the script is run. Upon completion of execution of the script, it's switch in Exterior is turned off automatically. If you turn the script's switch off while the script is running, the script will be terminated without it's execution completing.
User variables such as the sheet name, app path, script folder path, GitHub credentials etc are available in the environment variables.
import os
print(os.environ["SC_COMPUTER_NAME"]) #Prints the name of sheet in Exterior connected to the ScriptCaster on the machine
print(os.environ["SC_APP_FOLDER_PATH"]) # Prints path to ScriptCaster app directory
print(os.environ["SC_USERSCRIPTS_FOLDER_PATH"]) # Prints path to folder containing the scripts
print(os.environ["SC_GITHUB_USERNAME"]) # Prints username of GitHub account containing the scripts
print(os.environ["SC_GITHUB_REPO_NAME"]) # Prints name of GitHub repository containing the scripts
print(os.environ["SC_GITHUB_ACCESS_TOKEN"]) # Prints personal access token
# To obtain the path to the credentials folder -
print(os.path.join(os.environ["SC_APP_FOLDER_PATH"],"creds/"))