PDF Expert integration scripts

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

This is awesome- works great- thanks so much!

1 Like

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

Hi guys. Complete newbie here. I had a quick read of the Integrations instructions but I’m clearly missing a key point. I’m unsure as to where / how you are supposed to actually save these script files to invoke them in Hook. This PDF Expert one is bang on for what I need so thanks @stevelw for creating this.

Would you have the patience in explaining how / where I have to save the script(s)? Thanks in advance for your help.

The instructions for editing Hook scripts are here. Let me know if you’re still lost.

1 Like

No. I figured it out. Thanks Steve. Works great. Much appreciated.

2 Likes