Skip to content

Instantly share code, notes, and snippets.

View Pe8er's full-sized avatar
🤡
Calzone will not be tolerated

Piotr Gajos Pe8er

🤡
Calzone will not be tolerated
View GitHub Profile
on run arguments
-- Debugger
if class of arguments is script then set arguments to {"US/Pacific", "Pacifica", "24"}
tell arguments
-- Set up the location and city name
set theLocation to item 1
{
"BTTPresetName" : "Default",
"BTTPresetUUID" : "77CE7DAA-5E4B-4BD5-AE1C-7165D3F519FF",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppSpecificSettings" : {
},
set nextEvent to do shell script "~/.dotfiles/bin/icalBuddy -ec 'Found in Natural Language' -npn -nc -iep 'datetime,title' -po 'datetime,title' -eed -ea -n -li 1 -ps '|: |' -b '' eventsToday"
--log nextEvent
if nextEvent is not "" then
set AppleScript's text item delimiters to " @& "
set itemCount to count of text items of nextEvent
--log itemCount
if itemCount is 1 then
{
"BTTWidgetName" : "Next Event",
"BTTTriggerType" : 639,
"BTTTriggerTypeDescription" : "Apple Script Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : 49,
"BTTPredefinedActionName" : "Launch Application \/ Open File \/ Start Apple Script …",
"BTTLaunchPath" : "file:\/\/\/Applications\/Calendar.app",
"BTTAdditionalConfiguration" : "\/bin\/bash:::-c",
"BTTEnabled2" : 0,
@Pe8er
Pe8er / (0000) Album_00 Title.m4a.ptsp
Created April 30, 2025 19:23
My Picard File Rename Script
title: (0000) Album/00 Title.m4a
description: |
This preset example file naming script does not require any special settings, tagging scripts or plugins.
author: MusicBrainz Picard Development Team
license: GNU Public License version 2
version: '1.0'
last_updated: 2019-08-05 13:40:00 UTC
script_language_version: '1.0'
script: |
%albumartist%/\($if(%originalyear%,%originalyear%,$if(%date%,$left(%date%,4),0000))\) %album%/$if($gt(%totaldiscs%,1),%discnumber%-)$num(%tracknumber%,2) $if2(%albumartist%,%artist%) - %title%