BusyCal in Hook to New?

When I drop down the “Hook to New” menu, BusyCal is not listed. BusyContacts is listed. I see both programs on the script page? Did I screw it up somehow?

Thanks in advance

No one has any ideas? Would a reinstall of Hook fix the problem?

Thanks.

Looking at the scripts for BusyCal there is no inbuilt New Item script. You’d have to add one.

OK… thank you. I’ll see what I can do.

BusyCal has some applescript support, but it does not return the selected event via applescript. So we would still need to do UI Scripting.

BusyCal can create a new event, but does not return a URL which is needed to automate linking. We could do this via UI scripting (that’s what BusyContact’new script does). But UI Scripting is brittle. We can have a look, but the best course of action is for the Busy devs to return a URL.

Thank you for the explanation. I had a hunch there was a reason.

Here’s a New Item script for Busy Cal. We’re sharing it here before uploading it to Hook’s integration server in case anyone wants to give it a whirl and give us some feedback.

tell application "BusyCal"
activate
open location "busycalevent://new/" & "$title"
end tell
delay 0.5

set startOfURL to "busycalevent://info/"

tell application "System Events"
	tell process "BusyCal"
		set the clipboard to ""
		try
			if enabled of menu item "Copy Event URL to Clipboard" of menu 1 of menu bar item "File" of menu bar 1 then
				-- Item selected
				click menu item "Copy Event URL to Clipboard" of menu 1 of menu bar item "File" of menu bar 1
				set urlFound to false
				repeat 10 times
					set theURL to the clipboard
					if theURL contains startOfURL then
						set urlFound to true
						exit repeat
					else
						-- Clipboard doesn't contain URL of selected item, so try getting clipboard again
						delay 0.1
					end if
				end repeat
				if urlFound then
					return theURL
				end if
			end if
		end try
		if enabled of menu item "Copy Event URL to Clipboard" of menu 1 of menu bar item "Edit" of menu bar 1 then
			-- Item selected
			click menu item "Copy Event URL to Clipboard" of menu 1 of menu bar item "Edit" of menu bar 1
			set urlFound to false
			set theURL to ""
			
			repeat 20 times
				try
					set theURL to the clipboard
				end try
				if theURL contains startOfURL then
					set urlFound to true
					exit repeat
				else
					-- Clipboard doesn't contain URL of selected item, so try getting clipboard again
					delay 0.1
				end if
			end repeat
			if urlFound then
				get theURL
			end if
		end if
		
		-- else item not selected
	end tell
	
end tell

Thank you!

Thank you for doing this. It works for me with only one issue - this could be on BusyCal’s side and nothing you can do about it.

When I hook to a new event, the new event is created as an all-day event with a 9 am alarm.

If I uncheck the “all-day” option, the event falls back to my default start time of 9 am, as it should. But the alarm keeps the 9-hour differential that existed when it was an all-day event (i.e. Midnight to 9 am) - the event time changes to 9 am but the alarm is now “9 hours after” the event start time.

This may simply be the result of how I have the app configured for me. Thanks again for doing this.

busycal