Does anyone have any idea why do shell script isn’t working with the Foundation framework?
use framework "Foundation" -- works with this line removed.
do shell script "basename a/b/c/d/file.ext"
Does anyone have any idea why do shell script isn’t working with the Foundation framework?
use framework "Foundation" -- works with this line removed.
do shell script "basename a/b/c/d/file.ext"
The do shell script command is part of the StandardAdditions.osax, a scripting addition. When you use the use statement AppleScript will not load scripting additions by default. For backward compatibility when the use statement is not used inside a script, scripting additions are loaded.
Therefore change the script to:
use framework "Foundation" -- works with this line removed.
use scripting additions
do shell script "basename a/b/c/d/file.ext"
Perfect. Many thanks.