Skip to content

DoScript is a dead-simple scripting language for everyday file automation.

License

Notifications You must be signed in to change notification settings

TheServer-lab/DoScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DoScript πŸš€

Stop writing Python boilerplate. Start automating.

DoScript is a dead-simple scripting language for everyday file automation. If you can write plain English, you can automate your computer.

do organize-downloads.do

That's it. No imports, no classes, no boilerplate.


Why DoScript?

Before: You write 30 lines of Python just to organize files by type.

After: You write this:

# organize-downloads.do
for_each file_in here
    if file_ext == ".pdf"
        move file to "Documents/PDFs/{file_name}"
    end_if
    if file_ext == ".jpg" or file_ext == ".png"  
        move file to "Pictures/{year}/{month}/{file_name}"
    end_if
end_for
say "βœ“ Downloads organized!"

Run it: do organize-downloads.do


Quick Start

Windows (Recommended)

  1. Download the installer (One-click setup)
  2. Open Command Prompt anywhere
  3. Create your first script:
echo say "Hello World!" > hello.do
do hello.do

From Source (All platforms)

git clone https://github.com/TheServer-lab/DoScript.git
cd DoScript
python doscript.py examples/hello_world.do

Requirements: Python 3.8+


Real Examples That Actually Help

πŸ—‚οΈ Organize Downloads by Type

# organize-downloads.do
for_each file_in here
    if file_ext == ".pdf"
        move file to "Documents/{file_name}"
    end_if
    if file_ext == ".jpg" or file_ext == ".png"
        move file to "Pictures/{file_name}"
    end_if
    if file_ext == ".zip"
        move file to "Archives/{file_name}"
    end_if
end_for

🧹 Delete Old Files (30+ days)

# clean-old-files.do
for_each file_in deep
    if file_is_old_days > 30
        say "Deleting: {file_name} ({file_is_old_days} days old)"
        delete file_path
    end_if
end_for

πŸ“Έ Backup Photos by Date

# backup-photos.do
for_each file_in deep
    if file_ext == ".jpg" or file_ext == ".png"
        copy file to "D:\Backup\{year}\{month}\{file_name}"
        say "Backed up: {file_name}"
    end_if
end_for

πŸ” Find Large Files (50MB+)

# find-large-files.do
for_each file_in deep
    if file_size_mb > 50
        say "{file_name}: {file_size_mb}MB at {file_path}"
    end_if
end_for

πŸ”„ Rename Files in Bulk

# rename-screenshots.do
global_variable = counter
counter = 1

for_each file_in here
    if file_name starts_with "Screenshot"
        move file to "screenshot_{counter}{file_ext}"
        counter = counter + 1
    end_if
end_for

πŸ“ See 20+ more examples β†’


Features That Make Life Easy

βœ… Built-in Safety

# Test before running for real
do cleanup.do --dry-run

# See what's happening
do backup.do --verbose

πŸ“… Time Variables (Built-in)

say "Backup created on {today} at {now}"
# Output: Backup created on 2024-02-08 at 14:30:45

make folder "Backups/{year}/{month}/{day}"
# Creates: Backups/2024/02/08

Available: {time}, {today}, {now}, {year}, {month}, {day}, {hour}, {minute}, {second}

πŸ“Š Rich File Metadata

Inside for_each loops, you get instant access to:

for_each file_in deep
    say "{file_name}"           # filename.txt
    say "{file_path}"           # C:\full\path\filename.txt  
    say "{file_ext}"            # .txt
    say "{file_size_mb}"        # 2.5
    say "{file_is_old_days}"    # 45
    say "{file_modified}"       # Unix timestamp
end_for

πŸ“– See all metadata β†’

🌐 Cross-Platform

Write once, run anywhere:

  • βœ… Windows (tested on 10/11)
  • βœ… macOS (10.15+)
  • βœ… Linux (Ubuntu, Debian, Arch, etc.)

πŸ”§ Modern Features

  • JSON/CSV support: json_read, csv_read, json_get, csv_get
  • Archive handling: zip, unzip, zip_list
  • Network operations: download, upload, ping
  • Process control: run, capture, kill
  • Error handling: try/catch blocks
  • Functions & macros: Reusable code blocks

Documentation

Doc Description
Quick Start Guide Get running in 5 minutes
Language Reference Complete command list
Examples Library 20+ ready-to-use scripts
FAQ Common questions

Why Not Just Use...?

vs. Bash/Shell Scripts

  • βœ… Readable by non-programmers
  • βœ… Cross-platform (same script on Windows/Mac/Linux)
  • βœ… File operations are first-class citizens

vs. Python

  • βœ… No boilerplate (import os, shutil, glob...)
  • βœ… Built for automation, not general programming
  • βœ… Instant file metadata without os.stat()

vs. Batch Files

  • βœ… Modern syntax
  • βœ… Works on all platforms
  • βœ… Rich error handling

vs. PowerShell

  • βœ… Simpler syntax
  • βœ… Faster to learn (5 min vs 5 hours)
  • βœ… No object pipeline confusion

DoScript is: "When Bash is too cryptic and Python is overkill"


Use Cases

Perfect for:

  • πŸ“ File organization & cleanup
  • πŸ’Ύ Backup automation
  • πŸ“¦ Software deployment/installation
  • 🧹 Scheduled maintenance tasks
  • πŸ“Š Log file processing
  • πŸ”„ Batch renaming & conversions

Not for:

  • Web servers or APIs
  • Complex data processing
  • Real-time applications
  • GPU-accelerated computing

Installation Methods

Option 1: Prebuilt Installer (Windows)

Download Latest Release β†’

One-click installer that:

  • βœ… Adds do command to PATH
  • βœ… Sets up file associations (.do files)
  • βœ… Installs syntax highlighting (optional)

Option 2: Manual Install

# Clone the repo
git clone https://github.com/TheServer-lab/DoScript.git
cd DoScript

# Run directly
python doscript.py your-script.do

# Or make it globally available
# Windows (PowerShell as Admin):
$env:PATH += ";$(pwd)"

# Linux/Mac:
sudo ln -s $(pwd)/doscript.py /usr/local/bin/do
chmod +x /usr/local/bin/do

Command-Line Usage

# Basic usage
do script.do

# With arguments (accessible as arg1, arg2, etc.)
do deploy.do production us-east-1

# Dry run (simulate without making changes)
do cleanup.do --dry-run

# Verbose output
do backup.do --verbose

# Combine flags
do deploy.do --dry-run --verbose staging

What's New in v0.6.1

  • ✨ Time variables: {today}, {now}, {year}, etc.
  • πŸ“Š JSON/CSV support: Read, write, and parse data files
  • πŸ“¦ ZIP operations: Create and extract archives
  • 🌐 Open links: open_link command
  • πŸ”„ Auto-update checker: Stay current automatically
  • πŸͺŸ Windows shutdown: System power control

πŸ“‹ Full Changelog β†’


Community & Support


Contributing

We'd love your help! Check out:


License

Server-Lab Open-Control License (SOCL) 1.0


Star History

⭐ Star this repo if DoScript saved you time!

It helps others discover the project and motivates continued development.


Made By

TheServer-lab - Building tools that make computing simpler.

DoScript: Because automation shouldn't require a CS degree.


Built with ❀️ for people who just want to organize their files