Created
          February 15, 2019 21:59 
        
      - 
      
- 
        Save thespacedoctor/38fe4beac4de6ac0b16d080565abfd58 to your computer and use it in GitHub Desktop. 
    [Filepath from Preview Mac App] #pdf #preview #applescript #filepath
  
        
  
    
      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 "System Events" | |
| tell process "Preview" | |
| set thefile to value of attribute "AXDocument" of window 1 | |
| end tell | |
| end tell | |
| -- macos comes with php installed you can decode this file name using php | |
| return do shell script "php -r 'echo urldecode(\"" & thefile & "\");'" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment