Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Manage Finder windows with AppleScript (update needed)

Hi all,


This older AppleScript no longer works like it used to... I would like to control the width of the Finder window list view columns..


Is there a way to get it working again?



-- otherFolder is just some secondary folder that you jump away from main to this one then back - that was a temp workaround to help activate the changes made on the primary folder

set otherFolder to alias ((path to library folder as text) & "Documentation:")

tell application "Finder"
	activate
	select Finder window 1
	set current view of Finder window 1 to list view
	set bounds of Finder window 1 to {50, 45, 1400, 900}
	set width of column id name column of list view options of Finder window 1 to 750
	set width of column id kind column of list view options of Finder window 1 to 153
	set width of column id modification date column of list view options of Finder window 1 to 190
	set width of column id size column of list view options of Finder window 1 to 99
	set sidebar width of window 1 to 200
	
	-- new for mavericks (see how old this is!)
	
	set frontWindowTarget to target of front window as alias
	set sort column of list view options of Finder window 1 to modification date column
	set sort direction of column id modification date column of list view options of Finder window 1 to reversed
	
	-- this next step is needed to help activate the main window changes as described above
	
	tell front window
		set its target to otherFolder
		set its target to frontWindowTarget
	end tell
end tell

Posted on Jun 10, 2019 7:55 AM

Reply

Similar questions

2 replies

Jun 30, 2019 8:30 AM in response to revDAVE

Hi Camelot,


Yes of course–so sorry for being vague.

Now, when I run this in the script editor, it seems to work fine - so I guess the script is doing it's job.


Previously, when run - intermittently it would not work as expected. (The main issue is that it did not sort the date modified in reverse order.)


It seems this issue was part of a bigger problem. in High Sierra - My finder was acting quite sluggish at times - and I am fairly sure this is what was affecting this script.


Finally I tracked down the sluggishness in the finder. As it turns out it was the desktop app for SYNC APP - https://www.sync.com


When I quit the App - everything works well.


Here's a thread I just posted on the issue...


https://discussions.apple.com/thread/250454365


Thanks for you help,


Dave

Jun 12, 2019 12:23 PM in response to revDAVE

You're going to need to provide more context here.


Saying that it '... no longer works like it used to' is not sufficient. What, specifically is not working? What's different now from when it 'used to work'?


Does it throw an error? does it turn your window upside down? does it do nothing?


As is, the script seems to run with no problem, so without knowing what's not working to your expectation, it's really hard to advise on any actions.

Manage Finder windows with AppleScript (update needed)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.