I have a complex AppleScript that for some reasons has to be executed as a single line command. My Script looks like:
tell application "Finder"
tell disk "'myDiskName'"
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 968, 421}
close
open
eject
end tell
end tell
I do execute the script using terminal by:
echo '<SCRIPT>' | osascript
where the is the multiline script above - and that works absolutely fine. Now, to be more specific, I want this script to be run using an ant-task, like:
<exec executable="echo">
<arg line="'<SCRIPT>' | osascript" />
</exec>
Since is multiline, it somehow gets ignored / not executed, but it doesn't throw an exception either. I see two solutions: either a single line command, which is preferable, or a standalone applescipt that gets called. Here's the thing: the script above needs some dynamic variables, that have to be generated from the antscript on runtime - so creating the script on the fly might not be an option.