Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Applescript: PathLabeller' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Applescript: PathLabeller
Authored by: osxpounder on Nov 24, '04 01:17:39PM

Thanks for the groovy script. Have you put it through its paces yet--chosen every label? I get weird probs when I run it:

If I choose 1, I actually get Orange, the label that should be number 2.

If I choose 2, I actually get Red, the label that should be number 1.

If I choose 3, I get Yellow, the proper label.

If I choose 4, I actually get Blue, the label that should be 5.

If I choose 5, I actually get Purple, the label that should be 6.

If I choose 6, I actually get Green, the label that should be 4.

If I choose 7, I actually get Gray, the proper label.

No matter what I choose, the script always stops with an error. It labels the entire path, but after doing so, it stops with an error.

I'm not using a launcher app. Instead, I saved the script as an application [no startup screen] and put its alias on my Finder toolbar. I also tried running it directly from Script Editor, first. Results are the same, either way.

The label mismatches are a bit weird, but workable. Is there any way I can stop the script from ending with that error, though?

---
--
osxpounder



[ Reply to This | # ]
Applescript: PathLabeller
Authored by: osxpounder on Nov 24, '04 02:27:15PM

Heh, I figured out why I get the error message: I need to replace "1.Work" in your script with the name of the topmost folder on my own Mac, which, for my purposes, will be "Documents".

Still have no idea why the colors/labels are shuffled around, though.

Now I'm going to graft a dialog box onto this script to remind me that the color choices are mixed up. @whee!

---
--
osxpounder



[ Reply to This | # ]
Applescript: PathLabeller
Authored by: sinjin on Nov 24, '04 02:49:15PM
Glad you like it!
Heh, I figured out why I get the error message: I need to replace "1.Work" in your script with the name of the topmost folder on my own Mac, which, for my purposes, will be "Documents".
Yup. If you don't name the top most folder correctly it will try to keep labelling up to the root level of your drive and reach and error when it can't get any further. Sorry I wasn't more clear that you needed to change it!

The script is pretty bare (no error trapping, etc) so one could add dialogs and handlers to deal with user "mistakes" if they wanted to make it more accessible to others. For example, the script will die if you enter anything other than 0 through 7. With coersion and "try" handlers you could get it to kick back to the user for a valid label entry. You could even get it to accept text (e.g "Red") instead of numbers to be more intuitive, which gets me to your next problem...

Still have no idea why the colors/labels are shuffled around, though.
That isn't an error. For whatever reason the order you see the labels listed in contextual menus does not match their numerical order! There is probably a "legacy" reason for the integer value while the order in the menu is more pleasing to the eye, or something like that.

[ Reply to This | # ]