Show Item Info

Joined
Jan 12, 2005
Messages
1,278
Reaction score
13
Points
38
Location
/home/sheffield/UK
Your Mac's Specs
12" 1Ghz PB 768Mb 10.4.5 30Gb Video iPod 40Gb 3G iPod 1Gb iPod Shuffle
Is it me or doesn anyone else find this a load nothing but useless?

Im always creating and deleting files so the amount of disc space i have constantly changes but the info on the desktop doesnt even though it does in Finder :(

Anyone know of a method/hack to make this update more frequently?
 
L

lil

Guest
Do you mean the hard disk space shown underneath 'Macintosh HD' (or whatever you have it named) if you have view options (command + j) set to show item info?

If so, yes - it doesn't update; and something needs doing about it as otherwise, Tiger is without a doubt the quickest OS to reflect file system changes - yet this little bit doesn't update unless you reboot which is ridiculous.

Relaunching the finder (command+option+esc) does refresh this info though but like you - that isn't good enough!

I'll see what can be dug up, but if anything, the Finder IMO needs a bit of TLC from Apple...

Vicky :flower:
 
L

lil

Guest
Solution

Ok, your post spurred me on to sort this 'bug' out. Before Tiger, Finder was notoriously slow at reflecting file system changes in some instances.

-----------
EDIT

I have attached a ZIP archive called Refresh Finder.zip In this you will find the filerefresh.sh shell script and the Refresh Finder.app AppleScript file. Create a folder called Scripts in your home folder's Documents folder. You will need to edit filerefresh.sh as shown in the rest of the information here.

The change required is to change the name of your home folder, as the filerefresh.sh file refers to 'vicky' as that is my home folder, unlikely yours is.

------------

I warn you, this will involve some use of the Terminal and some command line stuff, it's nothing complex (IMO) and if you stick to the instructions you will be fine, if you are already very terminal competent, you'll find this a walk in the park

OK,here's what I did...

First of all, open the Terminal. (Command + Shift + U on the finder desktop) will open the Utilities window, double click on Terminal, you should get something like:

Last login: Sun Oct 23 13:02:24 on ttyp1
Welcome to Darwin!
sunshinesista:~ vicky$


now to show how quick Tiger's finder is at showing file system changes, type the following (where it says <ENTER> press return/enter, do NOT type <enter>)

cd desktop <ENTER>

Make sure the finder desktop is visible as best can be, the above command stands for change directory, in other words it is like double clicking on a folder in finder.

Now type:

touch test.txt <ENTER>

Notice how quick that file ended up on the desktop? Quick isn't it!

rm test.txt <ENTER>

Will delete the file again. However, when I did this I did it in the root (that means the very bottom level) of the Macintosh HD (or my hard drive in the PowerBook) and to my surprise, the disk space free updated (the Show Item Info line). So here's the kludgey but fully system compliant, and resource light way of getting that info to update every minute.

Open TextEdit (Command + Shift + A, D'click textEdit), and switch to text mode (Shift + Command + T). Type the following (as it is shown!):

#!/bin/sh
touch /users/vicky/documents/scripts/update.txt
mv /users/vicky/documents/scripts/update.txt /
rm /update.txt
/users/vicky/documents/scripts/refreshfinder.app


Now do a save as, and to keep things easy, go to your main user account (or your user account if you only have one set up like me) home directory, then documents. Create a new folder called 'Scripts' and in there name the file filespace.sh - make sure there is no .txt extension appended. If one is, navigate to the file, command + i on it to get info and remove .txt from the extension.

You should now have a file called 'filespace.sh' in that folder.

------
EDIT:

You will notice that we have an application called RefreshFinder.app now. This solves a complication whereby when you completed the set of instructions here, you would have to click Macintosh HD to show the updated file space. Not exactly very good huh? Still, if you did none of this and clicked Macintosh HD it still wouldn't show the updated disk space so it did fix that.

The RefreshFinder.app is an AppleScript program that is tremendously simplistic, it merely tells Finder to refresh all the icons on the desktop, so that macintosh HD will refresh as well, and thus show the update disk space sitiuation without you having to click it.

Just make sure the RefreshFinder.app is where you refer to it in the shell script, or in the Scripts folder in Documents that you have been instructed to make.

--

Go back to terminal and type:

cd /users <ENTER>

This will go back to the root (macintosh hd) and then change to the users directory. Then do the same but to cd into your user's directory name e.g: my user short name is 'vicky' so I then type:

cd vicky/documents/scripts <ENTER>

If my user's short name was 'Ernie' I'd do cd ernie/documents/scripts.

Now at the prompt type:

chmod 777 filespace.sh

What this does is turn that text file into an executable script. A script is just a file containing a sequence of commands to execute so you can do certain actions withoiut having to type one line at a time. The '777' part is an octal number which basically gives all the permissions we need for the script to be executable in the UNIX/BSD environment.

Ok, if this is all new to you, breathe in and out - you're doing well. To test this, open Macintosh HD, so its visible with the terminal too, and type:

/users/vicky/documents/scripts/filespace.sh <ENTER>

You should see the file update.txt appear and disappear very quickly. If you see '-bash: /users/vicky/documents/scripts/test.sh: Permission denied' the chmod went wrong. If the script fails, check what you typed into TextEdit and saved as filespace.sh is a verbatim copy of what I wrote above.

OK, good news, we're almost there!

In terminal:

cd /etc <ENTER>

it's a hidden folder, this is the stuff that OS X Finder really wants to keep away from you, for good reason, most users don't need it, most users don't even know that it is there!

Now to summarise, what we want to do is run that filespace.sh script every minute for this user, show that the Show Item Info updates to reflect space being consumed or being made due to file operations, to do this we edit something called our crontab file. This file contains a list of things that we want to execute (or run) at certain points of the day, I won't elaborate too much on cron - but if you type in cron help or something in google you'll get an idea. Essentially it runs tasks on a schedule as per its crontab file.

Now by default only the root user can change this and most Mac OS X setups do not have root enabled, it's disabled by default, so even an admin user trying to change things here will be told to sling their hook. So we use a command called 'sudo'. The root user is also know as the superuser, and sudo stands for 'superuser do'. Basically it allows us to do things as the superuser without being logged in as such.

So firstly, we back up the crontab file in case we mess things up. To do this we do:

sudo cp crontab crontab.bak <ENTER>

You will be asked for a password, enter you user name's password.

Now we are very close to getting there, we wish to edit this crontab file and tell the system run filespace.sh every minute please. So we use a UNIX text editor called pico - it's friendly compared to most :flower:

So type at the prompt:

sudo pico crontab <ENTER>

You will see it currently contains:

# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute hour mday month wday who command


Move the cursor to the end of the line with command, press enter for a new line and type:

* * * * * vicky /users/vicky/documents/scripts/filespace.sh

PLEASE NOTE : the spaces between the asterisks MUST be there, there is a space before the user name and as space after! :flower:

The asterisks mean merely 'every' so following the format shown this means EXECUTE for the USER vicky, the SCRIPT /users/vicky/documents/scripts/filespace.sh EVERY minute, hour, certain day of the month (eg: the 1st), on every month of every week day. In other words - every minute we are logged in. So all you need to change is the user name from 'vicky' to your short user name and likewise your user name in the path to the filespace.sh script.

When you have done this, press and hold Esc, and press O twice. so ESC (Hold), O, O - release all keys.

Press <ENTER> to accept the crontab name. If it says permission denied, you probably typed pico crontab instead of sudo pico crontab.

To quit pico, press and hold ESC, x, x - release. Pico will quit.

Done :flower:

Now on the minute, every minute, update.txt will be made in the root/Macintosh HD folder, and deleted and with it, the Show Icon Info will be updated too.

A kludge, but a fix, and a good one till Apple fixes it. At least it solved my problem :flower:

Any questions please ask - I tried to make this as simple as possible. You can of course save the filespace.sh wherever you like, even /bin (remember to use sudo!) and write filespace.sh in pico itself.

Also - you will have to do this for every user too in the crontab file; and in this instance it begins to make sense to save the file in /bin.

Hope this helps!

Vicky :flower:

View attachment Refresh Finder.zip
 
OP
inflexion
Joined
Jan 12, 2005
Messages
1,278
Reaction score
13
Points
38
Location
/home/sheffield/UK
Your Mac's Specs
12" 1Ghz PB 768Mb 10.4.5 30Gb Video iPod 40Gb 3G iPod 1Gb iPod Shuffle
Vicky your a total darling :)

im more than fine bashing away in terminal (get it? yea crap joke i know) so its working great thanks.

Thanks once again as its been of of those little things that annoys me so much, also the guide holds your hand alot so those who have never used the terminal before should be fine and thos like me that have compiled programs in linux should find it a walk in the park
 
L

lil

Guest
Bad news - what I originally wrote above seems to not work without clicking the Macintosh HD icon. BUT without any of the above, clicking Macintosh HD icon won't refresh it at all.

So with this in mind, I have edited the above, and attached a very very simple AppleScript application to refresh the finder desktop icons!

Now it will work a beauty :flower:

Only to glad to be of assitance, we both gained something out of this!!

Vicky
(off to edit original post with fix)
 
L

lil

Guest
Update posed with an attachment.

The AppleScript app for the curious is:

try
tell application "Finder" to update items of desktop
end try
 
L

lil

Guest
inflexion said:
Vicky your a total darling :)

Hehe, thanks :flower: Here to help!

inflexion said:
im more than fine bashing away in terminal (get it? yea crap joke i know) so its working great thanks.

grins :) Make sure you adjust for the few changes I made, now makes it seemless and perfected. The reason I use Macs is because I hate it when things don't work as they should, and 99.9% the Mac fulfils this, and hence - I will never use Windows, too many imperfections and annoyances!

That's why I had to fix this, as it annoyed me too.

inflexion said:
Thanks once again as its been of of those little things that annoys me so much, also the guide holds your hand alot so those who have never used the terminal before should be fine and thos like me that have compiled programs in linux should find it a walk in the park

I'm glad you feel it is pitched about right, I didn't just want to write do this do that, because beginners won't learn anything in the process. It is by learning and curiosity I got to where I am today, and I believe others can too.

After all, my erstwhile job at the AppleCentre was to help people, and thankfully I'm not just the blonde who can read a tech spec sheet :flower:

Vicky
 
OP
inflexion
Joined
Jan 12, 2005
Messages
1,278
Reaction score
13
Points
38
Location
/home/sheffield/UK
Your Mac's Specs
12" 1Ghz PB 768Mb 10.4.5 30Gb Video iPod 40Gb 3G iPod 1Gb iPod Shuffle
vicky the original fix you wrote worked fine for for me, it just updates after a minute like it should or where you on about your script?
 
L

lil

Guest
If it works then don't fix it :flower:

For some reason it decided to 'not work' 100% correctly, so I wrote the AppleScript bit into it to make it fool proof :flower:

That way it will definitely work.

Vicky
 
OP
inflexion
Joined
Jan 12, 2005
Messages
1,278
Reaction score
13
Points
38
Location
/home/sheffield/UK
Your Mac's Specs
12" 1Ghz PB 768Mb 10.4.5 30Gb Video iPod 40Gb 3G iPod 1Gb iPod Shuffle
naa thats cool then, if it helps i noticed that you never write documents in the paths with a capital D maybe thats why it dont work?
 
L

lil

Guest
maybe... but I always took it to be case-insensitive, we'll see :flower:

I'll play with it more tomorrow, just rounding off some PHP code right now hehe

Vicky
 
OP
inflexion
Joined
Jan 12, 2005
Messages
1,278
Reaction score
13
Points
38
Location
/home/sheffield/UK
Your Mac's Specs
12" 1Ghz PB 768Mb 10.4.5 30Gb Video iPod 40Gb 3G iPod 1Gb iPod Shuffle
hmmm im not too sure being a linux and java kid first i learnt the hard way about case sensitivity so i stick with it now, plus i cant live without the tab key when using Terminal.

as for PHP no thanks ill leave that to you :D
 
L

lil

Guest
Hehe, well once a C programmer, always a C programmer ;)

You can set the Mac OS to format its volumes as case sensitive so that

cd /users/vicky/documents

would fail until you did cd /Users/vicky/Documents

But I prefer case insensitivity, saves a lot of headaches. (Think late at night, 1000 line long terminal script, and it breaks somewhere, and you're looking for the one rogue capital or small letter hehe!)

As for the tab key, I expect this may explain why I don't tab-complete in IRC.

Guess that makes me a masochist or stupid :flower:

Stupid I think hehe :flower:

Vicky
 
OP
inflexion
Joined
Jan 12, 2005
Messages
1,278
Reaction score
13
Points
38
Location
/home/sheffield/UK
Your Mac's Specs
12" 1Ghz PB 768Mb 10.4.5 30Gb Video iPod 40Gb 3G iPod 1Gb iPod Shuffle
ahh well each to their own i guess but yea i wouldnt fancy going through 1000 lines looking for a wrong case letter
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top