-
Notifications
You must be signed in to change notification settings - Fork 0
DesktopRenamer AppleScript Guide
DesktopRenamer supports AppleScript, allowing you to automate space management, renaming, and window positioning.
Get the custom name of the currently active space.
tell application "DesktopRenamer"
set currentName to get current space name
display dialog "You are on: " & currentName
end tellGet a list of all detected spaces. The result is a newline-separated string where each line is formatted as ID~Name~DisplayID~Num.
tell application "DesktopRenamer"
set allSpaces to get all spaces
-- Example parsing: first space ID
set AppleScript's text item delimiters to "~"
set firstSpaceID to text item 1 of paragraph 1 of allSpaces
end tellRename the currently active space.
tell application "DesktopRenamer"
rename current space "Work Focus"
end tellRename a specific space by its internal ID.
tell application "DesktopRenamer"
rename space "1234-5678" to "Project Alpha"
end tellSwitch to a specific space by its internal ID.
tell application "DesktopRenamer"
switch to space "1234-5678"
end tellMove the currently active window to the next space on the current display.
tell application "DesktopRenamer"
move window next
end tellMove the currently active window to the previous space on the current display.
tell application "DesktopRenamer"
move window previous
end tellMove the currently active window to a specific space by its internal ID.
tell application "DesktopRenamer"
move window to space "1234-5678"
end tellToggle the visibility of the DesktopRenamer icon in the macOS menu bar. Returns the new visibility state (true for visible, false for hidden).
tell application "DesktopRenamer"
toggle menubar
end tellToggle both the Active and Preview label windows.
tell application "DesktopRenamer"
toggle labels
end tellToggle only the Active label window (the one showing the current desktop name).
tell application "DesktopRenamer"
toggle active label
end tellToggle only the Preview label window (the large labels shown during space switching or Mission Control).
tell application "DesktopRenamer"
toggle preview label
end tellToggle the "Keep visible on desktop" setting for the Active label window.
tell application "DesktopRenamer"
toggle desktop visibility
end tellThis script checks the current space name and toggles it between "Work" and "Break".
tell application "DesktopRenamer"
set currentName to get current space name
if currentName is "Work" then
rename current space "Break"
else
rename current space "Work"
end if
end tellThis script moves the active window to the next space and then switches the display to that space.
tell application "DesktopRenamer"
set allSpaces to get all spaces
set currentID to "" -- (Implementation detail: you'd need logic to find next ID)
move window next
delay 0.5
-- (Logic to switch to the known next ID)
end tell