Skip to content

Scripts

cp-img.bat

Takes one argument (a filename in the current directory) and then copies that file to subdirectories named according to all the SGC languages.

Example: "H:\OneDrive - SGC\scripts\BAT scripts\cp-img.bat" diagram.png


blacken.bat

Run it from the course directory of the files you want blackened. It will go through all the language subfolders created by Publisher files and recursively convert all .jpg files to greyscale. (It's hardcoded to only convert those languages, because there's no point in converting Aff files, since they're already greyscale.)

Example: "H:\OneDrive - SGC\scripts\BAT scripts\blacken.bat"


PubExport.vbs

Run it from the course directory of the Publisher files you want to export. It will go through all the .pub files in the folder and export JPG files of the pages to their proper subdirectories (assuming the pages are named properly in the .pub files)

Example: "H:\OneDrive - SGC\scripts\Publisher scripts\PubExport.vbs"


page_size_scan.bat

This will recursively run pdfinfo on a folder full of PDF files to check their page size. It currently only shows output for non Letter size pages.

The linux version of pdfinfo is now also available on the Hostinger server in the /tools/ directory.

page_size_scan.bat
@echo off
for /R %%f in (*.pdf) do (
  for /F "usebackq tokens=*" %%p in (`pdfinfo "%%f" ^| findstr /C:"Page size:"`) do (
    echo %%p | findstr /C:"612 x 792" > nul
    if errorlevel 1 (
      echo %%f:
      echo %%p
      echo.
    )
  )
)
pause