Re: closing MSWord files
Re: closing MSWord files
- Subject: Re: closing MSWord files
- From: Bryan <email@hidden>
- Date: Mon, 27 Nov 2000 14:14:52 -0500
- Organization: Apex Radiology
To change the file type you can use one of the following two OSAXen:
Set File Info of : ) Fridiric RINALDI's XCMD OSAX
set file creator: "Resource Access (ppc)" OSAX, 1.0, ) 1999 Marc Palluat de Besset
http://www.chez.com/mpalluat/"
Carl West wrote:
>
I get the feeling that somehow I'm not closing the MS Word files
>
properly in the script below. I'm opening a .doc file and saving it as a
>
.txt file, then I want to change it's type and creator, but I get an
>
error that says:
>
>
Can't set file type of <valid pathname>
>
>
The code in question:
>
------------------------------
>
set fileNameString to (curFile as string) -- from the on open list
>
set fileName to ObjectNameFromPath(fileNameString) -- as above but
>
without the extension
>
>
tell application "Microsoft Word"
>
activate
>
open fileNameString
>
do Visual Basic " <VB that saves the file as a text file>"
>
>
set text item delimiters of AppleScript to ":"
>
close window (the last text item of (fileName & ".txt"))
>
end tell
>
>
set theFile to fileName & ".txt"
>
>
tell application "Finder"
>
set the file type of theFile to "TEXT" --<<<<<<< this is where it
>
barfs >>>>
>
set the creator type of theFile to "ttxt"
>
end tell
>
------------------------------
>
>
All by itself as it's own droplet this works fine:
>
------------------------------
>
on open x
>
repeat with tFile in x
>
tell application "Finder"
>
set the file type of tFile to "TEXT"
>
set the creator type of tFile to "ttxt"
>
end tell
>
end repeat
>
end open
>
------------------------------
>
>
Any pointers? I'm new at this and I'm stuck.
>
>
--
>
Carl West email@hidden
>
617.262.8830 x246
>
>
I have no superfluous leisure; my stay must be
>
stolen out of other affairs; but I will attend you awhile.
>
>
- Isabella, Measure for Measure, Act 3 Scene 1
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users