This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
fuss:applescript [2015/05/16 03:33] – office | fuss:applescript [2022/04/19 08:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Mount All Transmit Favorites ====== | ||
+ | <code applescript> | ||
+ | --------------------------------------------------------------------------- | ||
+ | -- Copyright (C) Wizardry and Steamworks 2012 - License: GNU GPLv3 -- | ||
+ | -- Please see: http:// | ||
+ | -- rights of fair usage, the disclaimer and warranty conditions. | ||
+ | --------------------------------------------------------------------------- | ||
+ | tell application " | ||
+ | repeat with favoriteItem in favorites | ||
+ | tell current tab of (make new document at end) | ||
+ | connect to favoriteItem with mount | ||
+ | close | ||
+ | end tell | ||
+ | end repeat | ||
+ | end tell | ||
+ | </ | ||
+ | |||
+ | ====== Clear All Exif Data In Path or File ====== | ||
+ | |||
+ | <code applescript> | ||
+ | --------------------------------------------------------------------------- | ||
+ | -- Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 -- | ||
+ | -- Please see: http:// | ||
+ | -- rights of fair usage, the disclaimer and warranty conditions. | ||
+ | --------------------------------------------------------------------------- | ||
+ | on open exif_purge | ||
+ | repeat with pp in exif_purge | ||
+ | set p to POSIX path of pp | ||
+ | try | ||
+ | do shell script "/ | ||
+ | end try | ||
+ | end repeat | ||
+ | display dialog "All exif data in path or file \"" | ||
+ | end open | ||
+ | </ | ||
+ | |||
+ | ====== Use jsBeautify to Format Code ====== | ||
+ | |||
+ | <code applescript> | ||
+ | --------------------------------------------------------------------------- | ||
+ | -- Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 -- | ||
+ | -- Please see: http:// | ||
+ | -- rights of fair usage, the disclaimer and warranty conditions. | ||
+ | --------------------------------------------------------------------------- | ||
+ | tell application " | ||
+ | tell process " | ||
+ | try | ||
+ | keystroke " | ||
+ | end try | ||
+ | end tell | ||
+ | end tell | ||
+ | set txt to the clipboard | ||
+ | do shell script "echo " & quoted form of txt & " > / | ||
+ | set txt to do shell script "/ | ||
+ | do shell script "rm / | ||
+ | set the clipboard to txt | ||
+ | tell application " | ||
+ | tell process " | ||
+ | try | ||
+ | keystroke " | ||
+ | end try | ||
+ | end tell | ||
+ | end tell | ||
+ | </ | ||
+ | |||
+ | ====== Toggle Automatic Proxy On and Off ====== | ||
+ | |||
+ | Using an application that can be called via '' | ||
+ | |||
+ | ===== Download ===== | ||
+ | |||
+ | * {{fuss: | ||
+ | |||
+ | ===== Script ===== | ||
+ | |||
+ | You can toggle the automatic proxy on OSX via applescript by creating a script with the following contents: | ||
+ | |||
+ | <code applescript> | ||
+ | --------------------------------------------------------------------------- | ||
+ | -- Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 -- | ||
+ | -- Please see: http:// | ||
+ | -- rights of fair usage, the disclaimer and warranty conditions. | ||
+ | --------------------------------------------------------------------------- | ||
+ | set ethernetProxy to do shell script " | ||
+ | set wifiProxy to do shell script " | ||
+ | if ethernetProxy is " | ||
+ | if ethernetProxy is not "The parameters were not valid." | ||
+ | do shell script " | ||
+ | end if | ||
+ | if wifiProxy is not "The parameters were not valid." | ||
+ | do shell script " | ||
+ | end if | ||
+ | display notification " | ||
+ | else | ||
+ | if ethernetProxy is not "The parameters were not valid." | ||
+ | do shell script " | ||
+ | end if | ||
+ | if wifiProxy is not "The parameters were not valid." | ||
+ | do shell script " | ||
+ | end if | ||
+ | display notification " | ||
+ | end if | ||
+ | -- Allow notification to show. | ||
+ | delay 1 | ||
+ | |||
+ | </ | ||
+ | |||
+ | and then saving it as an application. | ||
+ | |||
+ | The AppleScript uses ''/ | ||
+ | <code bash> | ||
+ | chmod u+s / | ||
+ | </ | ||
+ | |||
+ | Note that this sets the stick bit on ''/ |