PDF Expert integration scripts

#1

I’ve seen some interest in PDF Expert integration. Here’s my script to integrate — ideally PDF Expert would add AppleScript support.

I don’t use PDF Expert myself and haven’t done much testing, so do let me know if this does what you want.

Get Name

tell application "System Events"
	get name of first window of process "PDF Expert"
end tell

Get Address

tell application "System Events"
	tell process "PDF Expert"
		if enabled of menu item "Show in Finder" of menu 1 of menu bar item "File" of menu bar 1 then
			click menu item "Show in Finder" of menu 1 of menu bar item "File" of menu bar 1
			delay 0.1
			tell application "Finder"
				set theItems to selection
				set ext to name extension of item 1 of theItems
				if ext = "hook" or ext = "HOOK" then
					set filepath to item 1 of theItems as alias
					return read POSIX path of filepath
				end if
				set theURL to URL of item 1 of theItems
				close front window
				activate application "PDF Expert"
				get theURL
			end tell
		end if
	end tell
end tell
3 Likes
PDF Expert integration
PDF Expert & Notability
#2

This is awesome- works great- thanks so much!

1 Like
#3

Just tried this, works perfectly and so easy to implement. Really enjoying Hook and exploring the ways in which it can enhance my work.

2 Likes