Automatic Icon Positioning (Packaging)

From Apache OpenOffice Wiki
Revision as of 01:19, 19 May 2007 by Ybart (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here is an Apple Script allowing to automatically place correctly the icon of OpenOffice :

Just need to replace "choose folder" with the path of the folder containing the OpenOffice packaging...

tell application "Finder"
	choose folder
	set fichiers to items of result
	set myText to ""
	set i to 0
	repeat with myItem in fichiers
		set itemProperties to (properties of myItem)
		set itemPos to position of itemProperties
		set myName to name of itemProperties
		set myText to myText & myName & ": " & (item 1 of itemPos) & ", " & (item 2 of itemPos) & return
		set i to i + 1
		-- display dialog i
		if i is 1 then set position of myItem to {332, 191} -- in alphabetic order "Applications"
		if i is 2 then set position of myItem to {97, 62} -- LICENSEs
		if i is 3 then set position of myItem to {101, 191} -- OpenOffice*
		if i is 4 then set position of myItem to {304, 61} -- READMEs
	end repeat
	-- display dialog myText
	return myText
end tell

To use it, assuming you called it ooo_pack_finalizer.scpt, just type : $ osascript ooo_pack_finalizer.scpt

Personal tools