Skip to content

Instantly share code, notes, and snippets.

View edenwaith's full-sized avatar

Chad Armstrong edenwaith

View GitHub Profile
@edenwaith
edenwaith / CreateAccessibilityInspectorAlias.scpt
Created December 9, 2021 05:39
AppleScript to create an alias in the Applications folder which points to the Accessibility Inspector.app contained within Xcode.
-- File: CreateAccessibilityInspectorAlias.scpt
-- Description: Create an alias in the Applications folder which points to the
-- Accessibility Inspector.app contained within Xcode.
-- Author: Chad Armstrong ([email protected])
-- Date: 8 December 2021
tell application "Finder"
set destinationFolder to "Macintosh HD:Applications"
set sourceApplication to "Macintosh HD:Applications:Xcode.app:Contents:Applications:Accessibility Inspector.app"
make new alias file at destinationFolder to sourceApplication
end tell
@edenwaith
edenwaith / build_ags.sh
Created December 12, 2020 20:12
A script to build a shell Mac app bundle from AGS 3.5.0
#!/bin/sh
# Place this script in the folder which contains CMakeLists.txt
export BUILD_TYPE=release
mkdir build_$BUILD_TYPE
cd build_$BUILD_TYPE
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
make
@edenwaith
edenwaith / make-android-icons.sh
Last active December 30, 2021 11:59
Take an image and output to various Android resolutions (ldpi - xxxhdpi)
#!/bin/sh
# make-android-icons.sh
# Author: Chad Armstrong
# Date: 11 December 2020
# Description: Take an image and output to various Android resolutions (ldpi - xxxhdpi)
# This script runs under macOS and requires ImageMagick to be installed.
# Need ImageMagick first
@edenwaith
edenwaith / build_app_bundle.sh
Last active January 2, 2021 03:00
Build and deploy the Mac app bundle for QT AGI Studio
#!/bin/sh
# build_app_bundle.sh
# Author: Chad Armstrong ([email protected])
# Date: 17 October 2020 - 1 January 2021
# Note: Run this script in the same directory as the agistudio.app bundle
# Print out the current working directory
function cwd {
PWD=`pwd`
echo "Current working directory is: $PWD\n"
@edenwaith
edenwaith / FindAGIGameID.c
Last active January 9, 2021 17:54
Check to see if an AGI Sierra game is either version 2 or 3.
/*
* FindAGIGameID.c
* Description: Check to see if an AGI Sierra game is either version 2 or 3.
* Author: Chad Armstrong
* Date: 29 April 2020
* To compile: gcc -Wall -o FindAGIGameID FindAGIGameID.c
* To run: ./FindAGIGameID
*
* References:
* - https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/glob.3.html
@edenwaith
edenwaith / CloseAcmeTabs.scpt
Created February 25, 2020 18:14
AppleScript to close all Atlassian-related tabs in Google Chrome
-- File: CloseAcmeTabs.scpt
-- Description: Iterate through all open Google Chrome windows and close any Atlassian-related tabs.
-- Author: Chad Armstrong
-- Date: 25 February 2020
tell application "Google Chrome"
-- Iterate through every Chrome tab and find any Atlassian pages (JIRA, Confluence)
set windowList to every tab of every window whose (URL starts with "https://wiki.acme.com/") or (URL starts with "https://jira.acme.com/")
set tabsToClose to 0
repeat with tabList in windowList
@edenwaith
edenwaith / local.markunreademails.plist
Last active January 22, 2020 17:23
Launch Agent property list to launch the Mark Unread Emails AppleScript each day at 9:00.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.markunreademails</string>
<key>ProgramArguments</key>
<array>
<!-- osascript /Users/chadarmstrong/Projects/Scripts/MarkUnreadEmails.scpt -->
<string>/usr/bin/osascript</string>
@edenwaith
edenwaith / MarkUnreadEmails.scpt
Last active December 3, 2024 12:15
An AppleScript to go through the mailboxes in Outlook and mark unread messages as read
-- File: MarkUnreadEmails.scpt
-- Description: Go through the mailboxes in Outlook and mark unread messages as read
-- Author: Chad Armstrong
-- Date: 22 November 2019
tell application "Microsoft Outlook"
set myInbox to folder "Inbox" of default account
set github to folder "GitHub" of myInbox
set other to folder "Other" of myInbox
@edenwaith
edenwaith / AppleScript.plist
Created November 23, 2019 02:22 — forked from Angles/AppleScript.plist
AppleScript for TextWrangler v2.0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- (ORIGINAL AUTHOR, ORIGINAL HEADER)
BBEdit Applescript Codeless Language Module.
Bill Hernandez <http://www.mac-specialist.com/>
Version 1.0.1
Updated - Monday, November 20, 2006 ( 6:41 PM )
Updated - Tuesday, November 21, 2006 ( 10:05 PM )
@edenwaith
edenwaith / CountOpenChromeTabs.scpt
Last active February 1, 2025 03:39
AppleScript: Count the number of open tabs in Google Chrome
-- CountOpenChromeTabs.scpt
-- Author: Chad Armstrong
-- Date: 30 August 2019
-- Description: Count the number of open tabs in Google Chrome
-- To run from CLI: osascript CountOpenChromeTabs.scpt
-- To create an alias command:
-- In ~/.bash_profile, add the line: alias counttabs='osascript ~/Projects/Scripts/CountOpenChromeTabs.scpt'
-- Refresh the bash shell environment: source ~/.bash_profile
tell application "Google Chrome"