This file contains hidden or 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
    
  
  
    
  | -- 让Finder展示或者不展示隐藏文件 | |
| on alfred_script(q) | |
| if q is "true" then | |
| do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true" | |
| else | |
| do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false" | |
| end if | |
| end alfred_script | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ###—————————————————————————————————————————————— | |
| # setKMVar() Sets KM Variable, Makes if needed | |
| # | |
| # Ver 2.0 2015-12-27 | |
| ###—————————————————————————————————————————————— | |
| on setKMVar(pKMVarName, pKMVarValue) | |
| --log ("setKMVar: " & pKMVarName & ": " & pKMVarValue) | |
| tell application "Keyboard Maestro Engine" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | -- Ask the user to select an app | |
| set theApp to choose file of type "app" default location (path to applications folder) | |
| -- Get the app name | |
| tell application "System Events" | |
| set theAppName to name of theApp | |
| if theAppName ends with ".app" then set theAppName to text 1 thru -5 of theAppName | |
| -- Determine whether the app is a package, and notify the user if it's not | |
| set isPackage to (package folder of theApp) | 
  
    
      This file contains hidden or 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 {input, parameters} | |
| tell application "Calendar" to activate | |
| delay 2 | |
| tell application "System Events" | |
| keystroke "f" using {option down} | |
| end tell | 
  
    
      This file contains hidden or 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
    
  
  
    
  | tell application "Safari" to activate | |
| set x to 187 | |
| set y to 22 | |
| set w to 973 | |
| set h to 816 | |
| tell application "System Events" | |
| tell process "Safari" to get first window | |
| set this_window to result | |
| set position of this_window to {x, y} | |
| set size of this_window to {w, h} | 
  
    
      This file contains hidden or 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
    
  
  
    
  | (* | |
| Installation instructions | |
| ========================= | |
| Run as an Application: | |
| 1) Open AppleScript Editor and create a new script | |
| 2) Paste this file into it | |
| 3) Save name it '§(Toggle Wi-Fi)' | |
| - Or substitute '§' for a symbol that you can press with a single key | |
| 4) Put it in Applications/Utilities | 
  
    
      This file contains hidden or 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
    
  
  
    
  | -- Get the currently selected item | |
| tell application "Finder" | |
| set currentFile to selection as text | |
| end tell | |
| set container to GetParentPath(currentFile) | |
| display dialog "File name and extension" default answer "New File.txt" | |
| set fileName to text returned of result | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ------------------------------------------------------------------------------------------- | |
| REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2016/01/10 05:18 | |
| ------------------------------------------------------------------------------------------- | |
| NOTES | |
| ------------------------------------------------------------------------------------------- | |
| AppleScript is a rather peculiar scripting language to learn. | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ignoring application responses | |
| tell application "System Events" to tell process "MacID" | |
| click menu bar item 1 of menu bar 2 | |
| end tell | |
| end ignoring | |
| do shell script "killall System\\ Events" | |
| delay 0.1 | |
| tell application "System Events" to tell process "MacID" | |
| tell menu bar item 1 of menu bar 2 | |
| --click menu item "Send clipboard text to all iOS clipboards..." of menu 1 | 
NewerOlder