Listed Folder view for all folders

Discussion in 'Apple' started by fabian, Jan 16, 2004.

  1. fabian

    fabian Guest

    I asked me if it's possible to set list view for all folders. Its to
    stupid to open up all folders and set them to list view. Could this be
    done through the command line?
     
    fabian, Jan 16, 2004
    #1
    1. Advertisements

  2. yes see the following applescript. Paste this into Script editor, save as an
    applet - you can then drag n drop folders or disks onto the applscript applet
    to set all windows to list view. (this also change window default postion
    column size and window size - you can adjust these as you see fit.

    This will take between 30 and 40 minutes to do an entire drive.

    script starts below dotted line

    --------

    on open theList
    repeat with a from 1 to count theList
    set cItem to (item a of theList)
    if (isFolder(cItem)) = true then SetViews(cItem)
    end repeat
    end open

    on isFolder(thePath)
    tell application "Finder"
    if kind of thePath = "folder" then return true
    return false
    end tell
    end isFolder

    on SetViews(theFolder)
    set theSubFolderList to getFolderList(theFolder)
    repeat with a from 1 to count theSubFolderList
    set cSubFolder to item a of theSubFolderList
    SetViews(cSubFolder)
    end repeat
    setFolderView(theFolder)
    end SetViews

    on getFolderList(theFolder)
    tell application "Finder"
    return every folder of theFolder
    end tell
    end getFolderList

    on setFolderView(theFolderPath)
    tell application "Finder"
    open theFolderPath
    ---> NOTE: The terminology in the following line has changed from OS 9.
    -- set current view of container window of theFolderPath to
    list view
    -- set zoomed of container window of theFolderPath to true
    -- close container window of theFolderPath
    end tell
    end setFolderView
     
    Fetch, Rover, Fetch, Jan 16, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.