Title to BusyCal event including date appending the title?

I am using BusyCal as my calendar app and would like to have the date of an event that i hooked to other items in parentheses appending the title. instead of “Meeting xy” I would like to have the title automatically set to “Meeting xy (25.11.2025)”. Is that somehow possible?

Background: When I take notes or link emails to recurring events such as meetings I usually “hook to new… Agenda” however, whenever I invoke hookmark, especially when I link a certain document to several occurences of the meeting on different dates, I only get “Meeting”. I would like to distinguish the linked events in the hookmark window. (Hope I could clarify my points properly, English is not my first language)

Thank you for contacing us, @anslogue_man .

Here is a script you can replace the scritp in Hookmark Settings window→Scripts→Busy Cal→Get Address, and click on save button. See if it works for you.

Thank you

Script
use framework "Foundation"
use scripting additions


on localizedStringFor:keyStr fromTable:stringsFileName inBundle:fileOrNSURL langID:langID
	set theBundle to current application's NSBundle's bundleWithURL:fileOrNSURL
	set sourceURL to theBundle's URLForResource:stringsFileName withExtension:"strings" subdirectory:"" localization:langID
	
	set theData to current application's NSData's alloc()'s initWithContentsOfURL:sourceURL
	if theData is missing value then return ""
	set sourceDict to (current application's NSPropertyListSerialization's propertyListWithData:theData options:0 format:0 |error|:(missing value))
	set destValue to sourceDict's objectForKey:keyStr
	return destValue as text
	
end localizedStringFor:fromTable:inBundle:langID:


set theURL to path to application "BusyCal"
set theBundle to current application's NSBundle's bundleWithURL:theURL

set langStr to ""
try
	set resultText to (do shell script "defaults read com.busymac.busycal-setapp AppleLanguages")
	set langIDs to {}
	set {TID, text item delimiters} to {text item delimiters, quote}
	set resultItems to text items of resultText
	text item 1 of resultText
	set text item delimiters to TID
	repeat with i from 1 to (count resultItems)
		if i mod 2 = 0 then set end of langIDs to resultItems's item i
	end repeat
	set langStr to first item of langIDs
	
end try

if langStr is missing value or langStr is "" then
	
	set langStr to first item of (current application's NSLocale's preferredLanguages as list)
end if

set langID to text 1 thru -4 of langStr
set copyEventStr to my localizedStringFor:"Copy Event URL with Title" fromTable:"Localizable" inBundle:theURL langID:langID
set fileStr to my localizedStringFor:"81.title" fromTable:"MainMenu" inBundle:theURL langID:langID
set editStr to my localizedStringFor:"205.title" fromTable:"MainMenu" inBundle:theURL langID:langID

if fileStr is "" or copyEventStr is "" or editStr is "" or editStr is missing value or fileStr is missing value or copyEventStr is missing value then
	set fileStr to "File"
	set copyEventStr to "Copy Event URL with Title"
	set editStr to "Edit"
end if
set afterTitle to " <busycalevent://info/"
set lengthOfClipboardAfterTitle to 69
set titleFound to false
tell application "System Events"
	tell process "BusyCal"
		set the clipboard to ""
		try
			if enabled of menu item copyEventStr of menu 1 of menu bar item fileStr of menu bar 1 then
				-- Item selected
				click menu item copyEventStr of menu 1 of menu bar item fileStr of menu bar 1
				set titleFound to false
				repeat 3 times
					set theURLWithTitle to the clipboard
					if theURLWithTitle contains afterTitle then
						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
				
			end if
		end try
		if enabled of menu item copyEventStr of menu 1 of menu bar item editStr of menu bar 1 then
			-- Item selected
			click menu item copyEventStr of menu 1 of menu bar item editStr of menu bar 1
			set titleFound to false
			set theURLWithTitle to ""
			repeat 20 times
				try
					set theURLWithTitle to the clipboard
				end try
				if theURLWithTitle contains afterTitle then
					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
			
		end if
		
		set d to ""
		
		click menu item "Dates" of menu 1 of menu item "Copy Details" of menu 1 of menu bar item editStr of menu bar 1
		
		repeat 20 times
			try
				set d to the clipboard
			end try
			if length of d is greater than 0 then
				exit repeat
			else
				-- Clipboard doesn't contain title of selected item, so try getting clipboard again
				delay 0.1
			end if
		end repeat
		
		-- else item not selected
	end tell
end tell


if titleFound then
	set oldDelimiters to AppleScript's text item delimiters
	
	set AppleScript's text item delimiters to afterTitle
	set trimmedTitle to first text item of theURLWithTitle
	set eventUrl to second text item of theURLWithTitle
	set AppleScript's text item delimiters to oldDelimiters
	
	set eventUrl to text 1 thru -2 of eventUrl
	return "[" & trimmedTitle & " " & d & "](busycalevent://info/" & eventUrl & ")"
	
end if


1 Like

Nice! Thank you! That is very neat! Now, I am not very adept in scripting and cannot identify the part where I can adjust the date style to DD.MM.YYYY or YYYY-MM-DD for example. Could you please point me to that line of code?

This is the script that copies the date via Edit→Copy Details→Dates. You probably can change the format in BusyCal Settings or System Settings.

1 Like

Thank you! I sent a mail to BusyCal asking for advice how to change the format.

That was quick. In a nutshell, their reply was sth like:

Changing the Copy Details format is not currently possible, but different formats could (no guarantee) be offered in the future.

I’ll have to settle with that workaround for now, which is fine. Thanks for your help @bchend :slight_smile:

1 Like