I’m trying to put together a browser which will show all of the contents of a computer’s hard drive, including the hidden items. I’ve looked at the demo code ("Browser"in the AppleScript Examples folder), but I can’t seem to get my head around it, and the built version only shows the visible items, not the hidden ones. I tried just copying the code, but it wouldn’t work for me (a whole bunch of errors). I’ve never used any type of data view before, so I’m in over my head here. :shock: Could anyone sort me out?
Thanks
Ok, I managed to get the browser to display information. The problem is, when I only have one disk, then the browser only displays one item in each column. The problem is solved when I have another disk (like a CD). Can anyone help me on that. Also, I still can’t figure out how to display hidden items.
Here is all of the code:
on number of browser rows theObject in column inColumn
if (count of diskNames) is greater than 1 then
if inColumn is 1 then
set rowCount to (count of diskNames)
else
tell browser "Browser" of window "browser"
set thePath to path for column inColumn - 1
end tell
tell application "Finder"
set rowCount to count of items of item thePath
end tell
end if
end if
return rowCount
end number of browser rows
on will display browser cell theObject in column inColumn browser cell browserCell row theRow
if inColumn > 1 then
tell browser "Browser" of window "browser"
set thePath to path for column inColumn
end tell
end if
tell application "Finder"
if inColumn is 1 then
set cellContents to displayed name of disk (item theRow of diskNames as string)
set isLeaf to false
else
set theItem to item theRow of item thePath
if class of theItem is folder or class of theItem is disk then
set isLeaf to false
else
set isLeaf to true
end if
set cellContents to (displayed name of theItem as string)
end if
end tell
set string value of browserCell to cellContents
set leaf of browserCell to isLeaf
end will display browser cell
on will finish launching theObject
tell application "Finder"
set diskNames to (name of every disk) as list
end tell
set rowCount to (count of diskNames)
end will finish launching