Apple examples NOT working!

Tried out the ‘Replace Text in Finder Names’ script and ‘Change Case of Item Names’ script provided by Apple, but they crash!

Error: Finder got an error: Can’t set name of alias “navi:Desktop:Pics:01.jpg” to “01.JPG”.

which happens on this line:

set the name of this_item to my change_case_of(current_name, "upper")

Any ideas what is going on? I am totally flumoxed having just got into Applescript - I was hoping to use these examples and adapt them to my own ends.

File permissions etc are fine. I’m running Tiger 10.4.11 recently reinstalled and updated.

Any thoughts would be much appreciated.

Ivan

The full script is in /Library/Scripts/Finder Scripts

I may be saying something stupid, but this “navi:Desktop:Pics:01.jpg” to “01.JPG” path looks weird …
What the hell is “navi” ?

Did you try putting those pics into another folder ? Try saving the script as a progiciel (not an application but the option underneath it). You also have to save inside the folder whose files you want to process…

I’ll check the script when I get home, but it doesnt look different from mine.

Where do you see that?

I have this solved now, but am unsure why the example code was not correct! I did get it to work in another folder before I changed it though! NUTS!

set name of item this_item to new_name

identifying thisItem as

folder, file or item

sorts this out, but why was it wrong in the first place?

Cheers,

Ivan

Open the “Replace Text in Item Names.scpt” script : I think it has to be placed inside the folder that you want to process … I may be wrong though. That’s what it said in mine when I opened it …

As noted by Apple in the script.

It does not matter where this script is run from it will either effect the front finder window or the desktop.
Personally, if I were going to use this script I would change it to choose folder instead. Nothing like running
a script and seeing all your desktop items suddenly changed because you forgot to have a Finder window open.

Cheers,

Craig

My bad.

You’re right, that’s exactly what I did, i edited the script so I could choose a folder (reason why I talked out of my butt there and a little confused with the location of the script, I could not remember precisely) instead of screwing up and crying like a baby afterwards … after all these are powerful toys that Apple puts in our hands ! :wink: