Hi
I have a few Automator workflows which I use in the right click menu. One is an encryption/decryption Applescript with an ‘on open xyz’ construct to get the file and its path to handle. Under Lion everything works perfectly. Under Mountain Lion it seems that such a construct is not supported anymore.
Anyone who has a tip how to get this to work under ML?
Regards
Lazy
The open handler still works in ML. Perhaps you could post some of your code so we san look for the problem.
Here is my code
on open mST
set schonda to “”
try
set schonda to do shell script “ps ax | grep -v grep | grep afplay”
end try
if schonda ≠“” then
say “a f play is running already”
return
end if
set f to (quoted form of POSIX path of (mST as text))
try
do shell script “afplay " & f & " & sleep 2 && kill $(ps ax | grep Programme/play.app | grep -v grep | awk ‘{print$1}’)”
end try
end open
in the automator workflow the code is as follows
foles or folders in Finder.app
pass input as arguments
code:
for f in “$@”
do
open -a /Volumes/eANW/Programme/play.app “$f”
done
So try putting some logging after the line where you use the open argument: set f to (quoted form of POSIX path of (mST as text)). That should really be ((item 1 of mST) as text), BTW – mST is a list.
But the logging should confirm that the open handler is working, and that the problem is somewhere else.
made the logging
it never gets inside the on open section
it executes everything outside on open
???
I should have some coffee before replying. If this is an Automator workflow, you don’t want an open handler. An open handler is used for drag-and-drop. Automator workflows use the run handler, as in:
on run {input, parameters}
Hi Shane
Your right. But: In Lion and the Leopards the on open scripts were running - to my surprise when I implemented it …
Regards to DownUnder and thanks for your input anyway.
Lazy