AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Open pdf file on mac8/30/2023 ![]() ![]() ![]() Set fName to my replace_chars(win_title, "' ", "") - have to unquote or comparison won't work if myFiles contains fName then tell proc You have to do something like: - `tell application "zathura"` - alas, Zathura is not a "Cocoa Application" - so I had to run lsof for the process PID and strip down the output to contain only filenames set myFiles to paragraphs of ( do shell script "lsof -F -p " & PID & " | grep ^n/ | cut -c2- ") Guess what? - Apparently you cannot grab list of all windows for a process (through - "System Events") if that process has fullscreen windows. Set PID to proc's unix id - I needed to figure out if this is the instance of Zathura with the - file on hand. Tell application "System Events " set zathuraProcList to a reference to ( every process whose name is "zathura ") On activate_open_instance( win_title, is_first_time) Set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text Set AppleScript's text item delimiters to the replacement_string Set the item_list to every text item of this_text Set AppleScript's text item delimiters to the search_string it's not even funny, I couldn't figure out the proper way of unqotting a - string in applescript with quoted form of POSIX path, so I did this instead on replace_chars( this_text, search_string, replacement_string)
0 Comments
Read More
Leave a Reply. |