I was prepared for AppleScript access from VW to be hard, but it turns out that it's pretty simple. I created a small script like this:
#!/usr/bin/osascript
tell application "Finder"
if folder "Applications" of startup disk exists then
return count files in folder "Applications" of startup disk
else
return 0
end if
end tell
And then executed a chmod 755. Then from Smalltalk, I did this:
ExternalProcess cshOne: '/Users/jarober/Documents/simple.scpt'
Did a printIt, and got back the same answer that I did at the command line. The thing that makes it all possible is that you can run an AppleScript the same way you can run an arbitrary shell script on Unix/Linux. Boy, that opens up some nice possibilities I wasn't aware of :)
Technorati Tags:
AppleScript, macintosh