What changed in Lion?

I used this script and it worked fine till I upgrade to Lion

set inputfolder to (choose folder)

set textutilPath to "/usr/bin/textutil"

-- get the input webarchive file and variables
set webarchiveFile to choose file with prompt "Choose the webarchive file to convert to rtfd:" without invisibles

-- calculate the output rtfd path
set rtfdPath to (webarchiveFile as text) & ".rtfd"

-- convert webarchive to rtfd
do shell script quoted form of textutilPath & " -format webarchive -convert rtfd -output " & quoted form of POSIX path of rtfdPath & space & quoted form of POSIX path of webarchiveFile

Now as I open it it runs forever and nothing happens

Do I need to change anything or Applescript in Lion is not longer supported?

Thanks everyone

Have you tried the shell script in Terminal?

Yes and still it runs forever with no results

There are no “errors” if I select the “force quit” command as
Applescript seems to be running fine

Mysteries of Lion and this is just one

I looked at the manual page (man textutil) for textutil and didn’t know where you got the “-format” thing. Try this in terminal first:

textutil -convert rtfd /path/to/webarchive

“-format” is used to specify the type of file, but textutil will automatically figure out what kind of file it is (in your case, a webarchive)