Bash
#!/bin/bash
# Script to open the folder "test" on your desktop in Visual Studio Code
# Filename: test.command
# Path to the folder
FOLDER_PATH="/Users/x/Desktop/test"
# Check if the folder exists
if [ ! -d "$FOLDER_PATH" ]; then
echo "Error: Folder $FOLDER_PATH does not exist."
exit 1
fi
# Open the folder in Visual Studio Code
code "$FOLDER_PATH"
echo "Opening $FOLDER_PATH in Visual Studio Code"
# Close the Terminal window
osascript -e 'tell application "Terminal" to close (every window whose name contains "test.command")' &