Brett Terpstra (@ttscoff) of Marked 2 and nvALT fame asked about my Alfred-Pinboard workflow.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run argv | |
tell application "System Events" | |
set desktopCount to count of desktops | |
repeat with desktopNumber from 1 to desktopCount | |
tell desktop desktopNumber | |
set picture to item 1 of argv | |
end tell | |
end repeat | |
end tell | |
--beep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# toggle-fn.scpt | |
# | |
# This AppleScript toggles the FN key state. | |
# | |
# To assign a keyboard shortcut (long story short): | |
# Export this AppleScript to an app (a service to just run the script won't have accessibility privileges) | |
# ----> In the script editor, go to File -> Export, change format to "Application" and save. It will create a .app file. | |
# When you try to run for the first time, it will ask for access to Accessibility control. Allow it. | |
# Create a service in Automator to open the app. | |
# Create a keyboard shortcut to run the service created in Automator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Date: 16-12-14 | |
Developer: codingChewie | |
Purpose: Takes filenames with whitespace and replaces with underscore in a directory | |
Version: 1.0 | |
Name: no-whitespace-files.scpt | |
Site: http://programmingmonkeys.com/ | |
*) | |
on no_whitespace(theFolder, scriptTitle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript -l JavaScript | |
app = Application("com.apple.iTunes"); | |
name = app.currentTrack().name() | |
artist = app.currentTrack().artist() | |
album = app.currentTrack().album() | |
duration = app.currentTrack().duration() | |
sec = duration / 60 | 0 | |
min = duration % 60 | 0 | |
if(min < 10) min = "0" + min | |
result = `${name} - ${artist}/${album} [${sec}:${min}]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set image_ext_list to {"jpg", "jpeg", "png"} | |
set size_list to {"64", "48", "32", "24", "16"} | |
set source_path to (choose folder "Select the folder with the base images" without invisbles) as text | |
set dest_path to (choose folder "Select the destination folder" without invisbles) as text | |
with timeout of 86400 seconds | |
tell application "Finder" | |
set image_files to (files of entire contents of (source_path as alias) whose name extension is in image_ext_list) as alias list | |
end tell | |
end timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set _Path to "<<enter path to your script folder here>>" | |
set scriptLaunch to text returned of (display dialog "Enter name of script to run" default answer "" buttons "OK" default button "OK") | |
if scriptLaunch contains "" then | |
error number -128 | |
else if scriptLaunch contains scriptLaunch then | |
try | |
set scriptRun to _Path & "/" & scriptLaunch & ".scpt" | |
run script scriptRun | |
on error | |
display alert "Your script failed to launch." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
display dialog "Show all files?" buttons {"Show", "Hide", "Cancel"} | |
set result to button returned of result | |
if result is equal to "Show" then | |
do shell script "defaults write com.apple.finder AppleShowAllFiles -boolean true" | |
do shell script "killall Finder" | |
else if result is equal to "Hide" then | |
do shell script "defaults delete com.apple.finder AppleShowAllFiles" | |
do shell script "killall Finder" | |
end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://stackoverflow.com/questions/37812664/end-of-central-directory-signature-not-found-when-installing-xcode-8-beta-xip/37857162#37857162 | |
on run argv | |
tell application "Archive Utility" to open POSIX path of (item 1 of argv) | |
repeat | |
delay 5 | |
if application "Archive Utility" is not running then exit repeat | |
end repeat | |
end run |
NewerOlder