I have a script which is called as an Automater plugin. I’m not sure if this matters, but the script is not embedded in the workflow due to some complexities in the script. Rather, there is a “Get Specified Finder Items” passed to an “Open Finder Items” which specifies the script as the “Open with” application.
Anyway, in the script there is a test on the kind of the selected item to see if it is a folder:
on open inPut
set deBug to 1
tell application "Finder"
set theObject to inPut as alias
set myKind to kind of theObject
if deBug > 0 then display dialog "myKind[3]: " & myKind
if myKind is "Folder" then
set myURL to URL of theObject
else
set myURL to URL of container of theObject
end if
. . .
Here’s where it gets weird: After selecting a folder on a server (I’ve tried AFP servers and SMB servers) the first time the script is run, “myKind” ends up blank. If the script is run again on the same selection, “myKind” returns “folder”. If I select another folder, the first time the script is run, myKind is again blank, but returns “folder” if it is run again without changing the selection.
This doesn’t seem to happen if the selection is a file of some sort. If also doesn’t happen if I select a folder on a volume that is local to my computer.
Any ideas?
T.