Scripting & Automation: Unclutter now supports AppleScript ✨

Scripting & Automation: Unclutter now supports AppleScript


Good news: today we’re shipping Unclutter 2.2.15 with AppleScript support.
This means other apps and tools can send commands to Unclutter — for example, create links to your files and notes, and automate parts of your workflow.

In this release we’ve added a small set of basic commands that already play nicely with Hookmark — a system-wide bookmarking app for macOS that lets you link to almost anything on your Mac (files, emails, documents, tasks, and more).

The scope is intentionally minimal for now, but we see plenty of potential and plan to grow it based on your feedback.
Below you’ll find the full command list, specs, and examples.

 

Enable or Disable Scripting & Automation

AppleScript support is enabled by default, but you’re in control.
Open Unclutter SettingsAdvanced and toggle Enable Scripting & Automation whenever you need.

 

current item info

This command returns the item(s) currently selected in Unclutter. Depending on which panel is active (or was last active), it will be either the selected file(s) in Unclutter Files or the note currently open in Unclutter Notes.

Result: list of unclutter item (if nothing is selected, the list is empty).

Example:

tell application "Unclutter"
	set selectionItems to current item info
	if (count of selectionItems) = 0 then return
	
	set uitem to item 1 of selectionItems
	log "type: " & (type of uitem)
	log "id:   " & (id of uitem)
	log "link: " & (link of uitem)
end tell

 

The unclutter item record
A canonical reference you can store and pass between commands.

  • type — text. Either “file” or “note”.
  • id — text. Stable unique identifier for the item.
  • link — text. Canonical link string for the item.

 

 


open note

Open the given note by reference.

Direct parameter: text — the note’s ID.
Result: boolean — true on success.

Example:

tell application "Unclutter"
    -- Replace with an actual note ID you’ve stored earlier
    open note "PUT-NOTE-ID-HERE"
end tell

 

 


create note

Create a blank note.

Parameters: none
Result: boolean — true on success.

Example:

tell application "Unclutter"
	set ok to create note
	if ok then
		-- A new blank note was created
	end if
end tell

 

 


create note with

Create a new note and set its initial content.

Direct parameter: text — note body
Result: unclutter item — canonical reference to the created note

Example:

tell application "Unclutter"
	set uitem to create note with "Meeting notes:\n– Action 1\n– Action 2"
	
	-- You can persist these for later use:
	set newId to id of uitem
	set newLink to link of uitem
	
	-- And open the note again whenever needed:
	open note newId
end tell