I am really new to applescript but managed to come up with the following droplet that converts a Word 2004 file to an rtf file (with appropriate extension). All works fine except that the new rtf file appears without an icon (but with its name underneatha blank square where the icon should be). Can anyone help? I have tried mending permissions but that doesn’t work. The script is as follows:
on open thefile
set text item delimiters to “/”
set thenewfile to POSIX path of thefile
set thenewfile to last text item of thenewfile
set lng to length of thenewfile
set x to lng - 3
set y to lng - 2
set z to lng - 1
set lastfour to character x of thenewfile & character y of thenewfile & character z of thenewfile & character lng of thenewfile
set x to x - 1
if lastfour is “.doc” then
set thenewfile to text from character 1 to x of thenewfile
end if
set thenewfile to thenewfile & “.rtf”
tell application “Microsoft Word”
open thefile
save as active document file name thenewfile file format format rtf
quit
end tell
quit
end open
Thanks for any help
James