Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Master macOS launcher automation with Raycast extensions and Alfred workflows. This skill covers TypeScript-based Raycast development, AppleScript/Python Alfred workflows, keyboard shortcuts, clipboard management, and productivity automation patterns.
When to Use This Skill
USE when:
Building quick access tools for developer workflows
# Install Alfred (Powerpack required for workflows)
brew install --cask alfred
# Alfred workflow locations# ~/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/# Create workflow via Alfred Preferences > Workflows > + > Blank Workflow
# Workflow components:
# - Triggers: Keywords, hotkeys, file actions
# - Actions: Scripts, open URL, run NSAppleScript
# - Outputs: Notifications, copy to clipboard, play sound
# Script languages supported:
# - bash, zsh
# - Python (2 or 3)
# - AppleScript / JavaScript for Automation (JXA)
# - Ruby, PHP, Perl
Development Environment
# For Raycast TypeScript development
npm install -g typescript @types/node
# For Alfred Python workflows
pip install alfred-workflow # (legacy, but useful patterns)# AppleScript tools
brew install --cask script-debugger # Optional: AppleScript IDE# Testing tools
brew install jq # JSON parsing
Core Capabilities
1. Raycast Script Commands
#!/bin/bash# Required parameters:# @raycast.schemaVersion 1# @raycast.title Open Project# @raycast.mode silent# Optional parameters:# @raycast.icon 📁# @raycast.argument1 { "type": "text", "placeholder": "Project name", "optional": false }# @raycast.packageName Developer Tools# Documentation:# @raycast.description Opens a project in VS Code# @raycast.author Your Name# @raycast.authorURL https://github.com/yourname
PROJECT="$1"
PROJECT_DIR="$HOME/projects/$PROJECT"if [ -d "$PROJECT_DIR" ]; then
code "$PROJECT_DIR"echo"Opened $PROJECT"elseecho"Project not found: $PROJECT"exit 1
fi
#!/bin/bash# @raycast.schemaVersion 1# @raycast.title Git Status# @raycast.mode fullOutput# @raycast.icon 🔀# @raycast.packageName Git# @raycast.description Show git status for current directory# @raycast.author workspace-hubcd"$(pwd)" || exit 1
if [ -d ".git" ]; thenecho"Branch: $(git branch --show-current)"echo""echo"Status:"
git status --short
echo""echo"Recent commits:"
git log --oneline -5
elseecho"Not a git repository"exit 1
fi
#!/bin/bash# @raycast.schemaVersion 1# @raycast.title Kill Port# @raycast.mode compact# @raycast.icon 🔌# @raycast.argument1 { "type": "text", "placeholder": "Port number" }# @raycast.packageName Developer Tools
PORT="$1"# Find process on port
PID=$(lsof -ti:$PORT 2>/dev/null)
if [ -z "$PID" ]; thenecho"No process on port $PORT"exit 0
fi# Kill the processkill -9 $PID 2>/dev/null
if [ $? -eq 0 ]; thenecho"Killed process $PID on port $PORT"elseecho"Failed to kill process on port $PORT"exit 1
fi
-- workflow-launcher.applescript
-- ABOUTME: Launch applications with Alfred
-- ABOUTME: AppleScript for application control
on alfred_script(q)
set appName to q
if appName is "" then
return "No application specified"
end if
try
tell application appName
activate
end tell
return "Launched " & appName
on error errMsg
return "Error: " & errMsg
end try
end alfred_script
-- window-manager.applescript
-- ABOUTME: Window positioning and management
-- ABOUTME: Move and resize windows with Alfred
on alfred_script(q)
-- Parse command: "left", "right", "top", "bottom", "maximize", "center"
set position to q
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
tell application "Finder"
set screenBounds to bounds of window of desktop
set screenWidth to item 3 of screenBounds
set screenHeight to item 4 of screenBounds
end tell
-- Menu bar offset
set menuBarHeight to 25
tell application frontApp
if position is "left" then
set bounds of front window to {0, menuBarHeight, screenWidth / 2, screenHeight}
else if position is "right" then
set bounds of front window to {screenWidth / 2, menuBarHeight, screenWidth, screenHeight}
else if position is "top" then
set bounds of front window to {0, menuBarHeight, screenWidth, screenHeight / 2}
else if position is "bottom" then
set bounds of front window to {0, screenHeight / 2, screenWidth, screenHeight}
else if position is "maximize" then
set bounds of front window to {0, menuBarHeight, screenWidth, screenHeight}
else if position is "center" then
set winWidth to 1200
set winHeight to 800
set xPos to (screenWidth - winWidth) / 2
set yPos to ((screenHeight - winHeight) / 2) + menuBarHeight
set bounds of front window to {xPos, yPos, xPos + winWidth, yPos + winHeight}
end if
end tell
return "Moved " & frontApp & " to " & position
end alfred_script
-- clipboard-cleaner.applescript
-- ABOUTME: Clean and transform clipboard content
-- ABOUTME: Remove formatting, convert text
on alfred_script(q)
-- Get clipboard content
set clipContent to the clipboard
if q is "plain" then
-- Convert to plain text
set the clipboard to clipContent as text
return "Converted to plain text"
else if q is "trim" then
-- Trim whitespace
set trimmed to do shell script "echo " & quoted form of clipContent & " | xargs"
set the clipboard to trimmed
return "Trimmed whitespace"
else if q is "lower" then
-- Convert to lowercase
set lowered to do shell script "echo " & quoted form of clipContent & " | tr '[:upper:]' '[:lower:]'"
set the clipboard to lowered
return "Converted to lowercase"
else if q is "upper" then
-- Convert to uppercase
set uppered to do shell script "echo " & quoted form of clipContent & " | tr '[:lower:]' '[:upper:]'"
set the clipboard to uppered
return "Converted to uppercase"
else if q is "slug" then
-- Convert to URL slug
set slugged to do shell script "echo " & quoted form of clipContent & " | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-'"
set the clipboard to slugged
return "Converted to slug: " & slugged
end if
return "Unknown command: " & q
end alfred_script
// raycast-snippets.json// ABOUTME: Text expansion snippets// ABOUTME: Common code templates and text patterns{"snippets":[{"name":"Python main block","keyword":"pymain","text":"if __name__ == \"__main__\":\n main()"},{"name":"TypeScript async function","keyword":"tsasync","text":"async function ${1:functionName}(${2:params}): Promise<${3:void}> {\n $0\n}"},{"name":"React component","keyword":"rcomp","text":"import React from 'react';\n\ninterface ${1:Component}Props {\n $2\n}\n\nexport function ${1:Component}({ $3 }: ${1:Component}Props) {\n return (\n <div>\n $0\n </div>\n );\n}"},{"name":"Console log","keyword":"clog","text":"console.log('${1:label}:', ${2:value});"},{"name":"Try catch","keyword":"trycatch","text":"try {\n $1\n} catch (error) {\n console.error('Error:', error);\n $0\n}"},{"name":"Date ISO","keyword":"dateiso","text":"{clipboard | date:iso}"},{"name":"UUID","keyword":"uuid","text":"{random:uuid}"},{"name":"Email signature","keyword":"esig","text":"Best regards,\n{user:name}\n{user:email}"}]}
-- alfred-hotkey-actions.applescript
-- ABOUTME: Global hotkey actions
-- ABOUTME: Quick actions for common tasks
on alfred_script(q)
-- q contains the action to perform
if q is "screenshot-region" then
do shell script "screencapture -i ~/Desktop/screenshot-$(date +%Y%m%d-%H%M%S).png"
return "Screenshot saved to Desktop"
else if q is "toggle-dark-mode" then
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
return "Toggled dark mode"
else if q is "empty-trash" then
tell application "Finder"
empty trash
end tell
return "Trash emptied"
else if q is "show-hidden" then
do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
return "Hidden files visible"
else if q is "hide-hidden" then
do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
return "Hidden files hidden"
else if q is "flush-dns" then
do shell script "sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder" with administrator privileges
return "DNS cache flushed"
else if q is "ip-address" then
set localIP to do shell script "ipconfig getifaddr en0"
set publicIP to do shell script "curl -s ifconfig.me"
set the clipboard to publicIP
return "Local: " & localIP & " | Public: " & publicIP & " (copied)"
end if
return "Unknown action: " & q
end alfred_script
# Clear Raycast cacherm -rf ~/Library/Caches/com.raycast.macos
# Rebuild extensioncd your-extension
npm run build
# Check for errors
npm run lint
Issue: Alfred workflow not executing
# Check script permissionschmod +x workflow-script.sh
# Test script manually
./workflow-script.sh "test query"# Check Alfred debug log# Alfred Preferences > Workflows > Click workflow > Debug
Issue: AppleScript permissions
-- Grant accessibility permissions
-- System Preferences > Security & Privacy > Privacy > Accessibility
-- Test permissions
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
Debug Commands
# Test Raycast script command
./script.sh "test argument"# Test Alfred Python script
python3 workflow.py "test query" | jq
# Check Alfred workflow variablesecho$alfred_workflow_data# Monitor Raycast logslog stream --predicate 'subsystem == "com.raycast.macos"'