# BusyCal support

**URL:** https://discourse.hookproductivity.com/t/busycal-support/391
**Category:** Share Hookmark automation
**Created:** [April 21, 2019, 2:28pm UTC](https://discourse.hookproductivity.com/t/busycal-support/391 "2019-04-21T14:28:58Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![stevelw](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@stevelw](https://discourse.hookproductivity.com/u/stevelw)
#### Post date: [April 27, 2019, 5:00pm UTC](https://discourse.hookproductivity.com/t/busycal-support/391/7 "2019-04-27T17:00:45Z")

</div>

OK, I have updated the scripts with a number of improvements.

1. The scripts should never hang in a loop now if the clipboard is not updated properly or the input is not formatted as expected.
2. A delay is only used if needed and proportionately to the delay needed for the speed of system and current load on the system.
3. Instead of using a loop to trim the Name the script uses a single calculation.

Hopefully this should speed up the scripts and make them much more robust.

> [@quorm](#):
>
> There is a long delay before the Hook window opens, so a user might think something is broken.

Are you still seeing the long delay? Hopefully not with these changes.

> [@quorm](#):
>
> A dividend of the BusyCal integration is that Hook works not only with calendar entries, but also with the reminders panel in BusyCal.

That’s great — I don’t use the To Do feature, so it’s good to know.

# Get Name

```auto
set afterTitle to " <busycalevent://info/"
set lengthOfClipboardAfterTitle to 69

tell application "System Events"
	tell process "BusyCal"
		if enabled of menu item "Copy Event URL with Title" of menu 1 of menu bar item "File" of menu bar 1 then
			-- Item selected
			click menu item "Copy Event URL with Title" of menu 1 of menu bar item "File" of menu bar 1
			set titleFound to false
			repeat 3 times
				set theURLWithTitle to the clipboard
				if theURLWithTitle contains afterTitle then
					set lengthOfTitle to (length of theURLWithTitle) - lengthOfClipboardAfterTitle
					set trimmedTitle to characters 1 thru lengthOfTitle of theURLWithTitle as string
					set titleFound to true
					exit repeat
				else
					-- Clipboard doesn't contain title of selected item, so try getting clipboard again
					delay 0.1
				end if
			end repeat
			if titleFound then
				get trimmedTitle
			end if
		end if
		-- else item not selected
	end tell
end tell

```

# Get Address

```auto
set startOfURL to "busycalevent://info/"

tell application "System Events"
	tell process "BusyCal"
		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 3 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
				get theURL
			end if
		end if
		-- else item not selected
	end tell
end tell

```

---

_[View the full topic](https://discourse.hookproductivity.com/t/busycal-support/391)._
