ANNOUNCE: Project using Pashua and PrefsStorageLib

My release may be based on old concepts, but here it is in case you’re interested.

It’s a new (ish) implementation of an old project that makes extensive use of Pashua and Shane’s PrefsStorageLib. Completely open and editable. It’s on my blog and in my Github list of gists.
It’s called Desktop Wrap, and you can find it in my gist list at Github–>loshlee
Thanks to Shane for PrefsStorageLib, and thanks to Carsten Blüm for Pashua.

1 Like

In case anyone has the same trouble I had finding it, here is the link:

1 Like

I wish I knew what the purpose of this script.

OK, sorry. The explanation is in the comment for the gist at Loshlee’s (my) site at GitHub. The purpose of the script is to create another script which can be used instantly to apply a group of placement/dispersal rules to icons on the desktop. The use of Pashua provides an interface of sorts for making the placement rules, and copying the script that applies those rules to the clipboard for pasting into your favorite AppleScript editor. The interface provides for much tighter arrangement of icons on the desktop, which is not at all affected by icon size or name length. If you don’t ever think about how your desktop icons are arranged, you wouldn’t likely be very interested. The inconvenience of the script (currently at least) is getting past the system security measures (accessed in Privacy & Security) for allowing AppleScript apps to talk to each other. You’ll probably have to save the script as an application before you’ll be allowed to run it, then you’ll have to add it at least once to Accessibility in Privacy & Security. Thanks for asking.

Ah, thanks, I see now. It looks pretty deluxe! I wrote a few very rudimentary script apps I keep in the Dock to align icons horizontally, align vertically, and distribute space.

Thanks! Is your script here? I’d like to try it. Anyway, if you try mine, please let me know whether you are able to get it working with Pashua and PrefsStorageLib.

Hi:

Here’s the one to align tops. It basically has all the alignments and I just comment out what I don’t need for different alignments.

`
– align selected desktop icons to topmost
– kerflooey

tell application “Finder”
set theItems to the selection
–return theItems
set theCount to count of theItems
–return theCount

-- get leftmost bounds
set boundsList to {}
repeat with anItem in theItems
	--return properties of anItem
	set theseBounds to (desktop position of anItem)
	set boundsList to boundsList & {theseBounds}
	--item 1 of theseBounds
end repeat

-------------------------------------------Get minLeft
set minLeft to item 1 of (item 1 of boundsList)
--return minLeft
repeat with thisPosition in boundsList
	set thisLeft to item 1 of thisPosition
	
	if thisLeft is less than minLeft then
		set minLeft to thisLeft
	end if
end repeat
--return minLeft

-------------------------------------------Get minTop
set minTop to item 2 of (item 1 of boundsList)
--return minTop
repeat with thisPosition in boundsList
	set thisTop to item 2 of thisPosition
	
	if thisTop is less than minTop then
		set minTop to thisTop
	end if
end repeat
--return minTop

(*
-------------------------------------------SET minLeft

repeat with itemPosition in theItems
	set dtPos to desktop position of itemPosition --> {2095, 1247}
	
	set (item 1 of (dtPos)) to minLeft
	--return dtPos --> {2092, 1247}
	set desktop position of itemPosition to dtPos
	
end repeat
*)


-------------------------------------------SET minTop

repeat with itemPosition in theItems
	set dtPos to desktop position of itemPosition --> {2095, 1247}
	
	set (item 2 of (dtPos)) to minTop
	--return dtPos --> {2092, 1247}
	set desktop position of itemPosition to dtPos
	
end repeat

end tell
`

Nice. Please let me know if you try Desktop Wrap.

.