Re: Home to top of the list.
Re: Home to top of the list.
- Subject: Re: Home to top of the list.
- From: Philip Aker <email@hidden>
- Date: Sat, 16 May 2009 14:00:47 -0700
On 2009-05-16, at 13:20:37, Robert Poland wrote: Not to sure what your solution is...
My example accommodates for when the Date Modified column is the selected sorting column in List view (by comparing dates). What I want to do is tell window 1 of the finder to select the top (first) item of the list display regardless of whether it is in the name view or not.
Then I think you will have to account for all the view possibilities (including Icon view and Column view) and branch the code for each one.
The reason is I want the window to scroll to the top rather that select some random point. Then when I click the zoom button the display will show the top viewable portion of the window. Seems like a problem for UI scripting because it looks like the Finder doesn't have any specific support for the needed facility. And actually, I think there may be a problem using UI scripting to click the mouse at a specific point (didn't work properly on 10.4 and I haven't tried it since then).
This works to home to top of folder IF IT'S SET TO NAME VIEW.
tell application "Finder" -- home to top of folder tell window 1 to select item 1 ...
If in a "date modified" view it still homes to the first item by name and not the top of the list.
Is there a command that will do this?
I'm having trouble interpreting the problem description. I think you mean something like the following (which will have to be changed if the sort direction is descending):
set hf to path to home folder tell application "Finder" set top to date ("Jan 24, 1984") set dlist to modification date of every item of hf repeat with i from 1 to count of dlist set d to item i of dlist if (d is greater than top) then set top to d end if end repeat set tlist to every item of hf whose modification date is top reveal item 1 of tlist end tell
Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@ Democracy: Two wolves and a sheep voting on lunch.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden