on Airdrop Download trigger

This commit is contained in:
Gabriel Radureau
2025-10-09 23:46:41 +02:00
commit c798e0c73e
5 changed files with 131 additions and 0 deletions

14
registerApp.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -eux
TEMPLATE_APP="/Applications/WatchDownloadsTemplate.app"
NEW_APP="/Applications/DanceVideosOnAirdropDownload.app"
SCRIPTS_DIR=$(dirname `realpath ${BASH_SOURCE[0]}`)
rm -rf "$NEW_APP"
cp -R "$TEMPLATE_APP" "$NEW_APP"
sed -i '' "s|echo hello world|${SCRIPTS_DIR}/onAirdropDownload.sh|g" "$NEW_APP/Contents/document.wflow"
launchctl unload ~/Library/LaunchAgents/com.user.watchdownloads.plist | :
cp ${SCRIPTS_DIR}/com.user.watchdownloads.plist ~/Library/LaunchAgents/com.user.watchdownloads.plist
launchctl load ~/Library/LaunchAgents/com.user.watchdownloads.plist
# launchctl list | grep watchdownloads
launchctl start com.user.watchdownloads