You are trying to find the folder of a string, not a file. The variable inName is just a string containing the name of the file, not a pointer to the file itself. If you want to get the containing folder of the currently selected file, you need to do a:
set pFolder to the folder of currItem
in the on open statement. Then you can do whatever you want with the folder. What are you going to do with the folder, anyway?
I'm writing a script (actually, cobbling together pieces of other people's scripts) to renumber files after they've been scanned. I wanted to know the parent folder so I could count the items in it, so I could reverse the numbering of the documents.
You are trying to find the folder of a string, not a file. The variable inName is just a string containing the name of the file, not a pointer to the file itself. If you want to get the containing folder of the currently selected file, you need to do a:
set pFolder to the folder of currItem
in the on open statement. Then you can do whatever you want with the folder. What are you going to do with the folder, anyway?
That works. Thanks!
I'm writing a script (actually, cobbling together pieces of other people's scripts) to renumber files after they've been scanned. I wanted to know the parent folder so I could count the items in it, so I could reverse the numbering of the documents.
Ah, cobbling together what others have done so that you can get something done yourself. The beauty of open source.
I hope you'll be posting that script.