Here’s the problem. I’m editting an existing script to choose a file when clicking run instead of acting as a droplet-script. Reason being, I want to log all events to really learn the script. But I can’t get the script to recognize the file chosen as a document and not just an alias.
Here’s the current code:
on run
display dialog “This is a droplet.” buttons {“OK”} with icon 0
end run
on open theItems
if (count theItems) is greater than 0 then
tell application “Finder”
repeat with num from 1 to count theItems…yada-yada
My revision:
on run
set theItems to choose file
if (count theItems) is greater than 0 then
tell application “Finder”
repeat with num from 1 to count theItems…yada-yada
The result to my version is the script skips all of the way to the “end run” and declares count theItems as 0.
Suggestions??
Model: g5
AppleScript: Script Editor
Browser: Safari 419.3
Operating System: Mac OS X (10.4)