----Activate Acrobat & Get Information
tell application "Adobe Acrobat Professional"
	activate
	-- Check to see if document is open
	if (count of documents) is 0 then
		beep
		display dialog "No documents found." buttons {"•"} default button 1 giving up after 3
		return
	end if
	---- Set Document Name, File Path and Page Number
	set Document_Name to name of active doc
	set File_Path to file alias of active doc
	set Page_Number to page number of PDF Window 1
end tell

---- New_Entry or Current Entry?
tell application "System Events"
	activate
	set New_Or_Selected_Entry to the button returned of (display dialog "Would you like to create a new entry or add to the currently selected entry?" buttons {"New", "Selected"})
end tell

----Activate Journler,Create New Entry OR Add Info/Resource to Selected Entry

---------- If Selected Entry, then add info to selected entry in Journler
if New_Or_Selected_Entry = "Selected" then
	tell application "Journler"
		activate
		set Selected_Entry to (selected entries)
		if Selected_Entry is {} then
			display dialog "No Entry Selected!" with icon 0
		else
			if (count Selected_Entry) = 1 then
				set the_Entry to item 1 of Selected_Entry
			else
				-- do a repeat loop to get them all into a list
				-- or warn that there are more than one.
			end if
		end if
		set Original_Text to rich text of the_Entry
		set rich text of the_Entry to Original_Text & return & " ****" & return & "Document Name: " & (Document_Name as string) & return & "Page Number: " & (Page_Number as string) & return
		make new resource with properties {owner:the_Entry, type:media, original path:(File_Path as alias), aliased:true}
		set the selected entries to {the_Entry}
	end tell
else
	
	--------- If New Entry, then create new entry in Journler's currently selected folder with info.
	tell application "Finder"
		duplicate file File_Path to "Macintosh HD:Users:psummerill:Documents:Journler:Journler Drop Box" with replacing
	end tell
	tell application "Journler"
		activate
	end tell
	set the clipboard to " ****" & return & "Document Name: " & (Document_Name as string) & return & "Page Number: " & (Page_Number as string) & return & "File Path: " & (File_Path as string)
end if