• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: List View Options
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List View Options


  • Subject: Re: List View Options
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 27 Jun 2011 10:10:55 -0500

After much experimenting I find that I can now create new folders with custom visible icons, however there is still a bug with this.

WHAT WORKS ...
What my script needed to do was create a new folder with only certain columns visible.
Here is my test script ...

tell application "Finder"
activate
if not (exists folder "test folder" of (path to desktop)) then
set folderAlias to make new folder at (path to desktop) with properties {name:"test folder"}
my setWindowAttributes(folderAlias, true, false, false)
else
set folderAlias to (folder "test folder" of (path to desktop)) as alias
end if
-- insert test scripting here
open window of folderAlias
beep
end tell

on setWindowAttributes(folderAlias, showModDate, showComment, sortByName)
tell application "Finder"
set winRef to (window of folderAlias)
set current view of winRef to list view
-- set icon size of list view options of winRef to small -- move to end. Sets cols to default.
ignoring application responses
set visible of column index 2 of list view options of winRef to showModDate -- mod date
set visible of column index 3 of list view options of winRef to false -- creation date
set visible of column index 4 of list view options of winRef to false -- size
set visible of column index 5 of list view options of winRef to false -- kind
set visible of column index 6 of list view options of winRef to false -- label
set visible of column index 7 of list view options of winRef to false -- version
set visible of column index 8 of list view options of winRef to showComment -- comment
set uses relative dates of list view options of winRef to false
set shows icon preview of list view options of winRef to false
if showComment then
set width of column index 1 of list view options of winRef to 300
else
set width of column index 1 of list view options of winRef to 340
end if
if sortByName then
set sort column of list view options of winRef to name column
set sort direction of sort column of list view options of winRef to normal
else if showModDate then
set sort column of list view options of winRef to modification date column
set sort direction of sort column of list view options of winRef to reversed -- most recent at top
end if
try
set toolbar visible of winRef to false -- waiting for bug to be fixed. Window must be open.
end try
set icon size of list view options of winRef to small
end ignoring
end tell
end setWindowAttributes ----------------------------------------------

The fix for this handler was to move the set icon size of ... line. That's all!

WHAT DOES NOT WORK ...
If you do not create a new folder, but try to change list view columns with set visible of column index ... commands at -- insert test scripting here , you will be successful ... until you manually change a column via the Finder's List View Options window (Command-J). Once you make a manual change, the visible columns become stuck on your manual change.

As far as I can tell from my experiments, the value (true/false) of a column's visible property is recorded properly as verified by using
 
get visible of column index n of list view options of winRef

But this value is not displayed correctly.
(And manually changing the icon size will cause columns to become "stuck", too, which is why I could fix my handler.)

 _______________________________________________
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

  • Follow-Ups:
    • Re: List View Options
      • From: Luther Fuller <email@hidden>
References: 
 >List View Options (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: TIFF to PDF - easiest way?
  • Next by Date: Change File's Icon With Script
  • Previous by thread: List View Options
  • Next by thread: Re: List View Options
  • Index(es):
    • Date
    • Thread