Skip to content

Instantly share code, notes, and snippets.

@ccstone
ccstone / List_Folder_Handler.applescript
Created November 30, 2018 23:06
AppleScriptObjC Handler to List a Folder by FURL, Path, or Name
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2018/11/30 16:19
# dMod: 2018/11/30 16:52
# Appl: AppleScriptObjC
# Task: List a Given Folder as type Furl, type Path, or by Name.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @ASObjC, @List, @Folder, @Furl, @Path, @Name
-------------------------------------------------------------------------------------------
@ccstone
ccstone / Raw_AppleScript_Event_Codes_2006.tsv
Last active October 27, 2023 15:20
Raw AppleScript Event Codes (2006)
Code Terminology Kind Usage Line
$scr scripting additions folder Property of class: domain System Events : Disk-Folder-File Suite 1
%doc music folder Property of class: user domain object System Events : Disk-Folder-File Suite 2
µdoc music folder Enumeration Standard Additions : File Commands 3
ƒhlp help Enumeration Standard Additions : File Commands 4
ƒhlp help folder Enumeration Standard Additions : File Commands 5
ƒlib shared libraries Enumeration Standard Additions : File Commands 6
ƒlib shared libraries folder Enumeration Standard Additions : File Commands 7
ƒmod modem scripts Enumeration Standard Additions : File Commands 8
ƒmod modem scripts folder Enumeration Standard Additions : File Commands 9
@ccstone
ccstone / Create date-string using ICU Date-Time Format Syntax.applescript
Last active June 5, 2021 20:47
Use AppleScriptObjC (ASObjC) to Create a date-string using ICU Date-Time Format Syntax
-------------------------------------------------------------------------------------------
# Auth: Shane Stanley & Christopher Stone
# dCre: 2014/01/19 09:46 +1100
# dMod: 2016/02/24 15:18 -0600
# Appl: AppleScriptObjC
# Task: Create a date-string using ICU Date-Time Format Syntax
# : http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @AppleScriptObjC, @ASObjC, @Shane, @Date, @String
@ccstone
ccstone / 0_reuse_code.js
Created January 29, 2016 05:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ccstone
ccstone / References For Learning & Using Applescript.md
Last active February 21, 2024 05:34
References For Learning & Using Applescript

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

@ccstone
ccstone / Edit_Email_in_BBEdit.applescript
Created June 25, 2013 19:29
This script will find the selected email message with Spotlight and open it in BBEdit for editing.<p> (Change "BBEdit" to "TextWrangler" to use the free version of BBEdit instead.)
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone <junksieve@thestoneforge.com>
# dCre: 2012-07-18 : 05:51
# dMod: 2013-06-25 : 14:26
# Appl: Mail & BBEdit
# Task: Open selected message's file in BBEdit for editing.
# Deps: Uses only OSX components.
# Test: Lion & Mountain Lion (might work in Snow Leopard but I cannot test).
# Tags: @Applescript, @Mail, @BBEdit, @Edit, @Message
-------------------------------------------------------------------------------------------
@ccstone
ccstone / Desktop_Sweeper.applescript
Last active December 8, 2023 22:15
An Applescript to sweep your desktop.Creates a dated folder inside ~/Documents/Sweep Desktop/ with newly swept items.Items may be grouped using their file extension (examples provided in the script).Items may be excluded by name, and items labeled with green, gray, or red are automatically excluded.
------------------------------------------------------------------------------------------------
# 2015/10/03 10:42
# NOTE: El Capitan breaks the whose clauses in this.
# They still work but take 30+ seconds instead of 3-4.
# I will update this with ASObjC when I get the chance.
------------------------------------------------------------------------------------------------
# Auth: Christopher Stone <junksieve@thestoneforge.com>
# dCre: 2012-09-30 : 16:51
# dMod: 2013-06-20 : 10:35
# Appl: Finder
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active November 16, 2023 19:32
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.