• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
closing MSWord files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

closing MSWord files


  • Subject: closing MSWord files
  • From: Carl West <email@hidden>
  • Date: Mon, 27 Nov 2000 13:18:22 -0500
  • Organization: VPG Integrated Media

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


  • Follow-Ups:
    • Re: closing MSWord files
      • From: Shane Stanley <email@hidden>
    • Re: closing MSWord files -- Solved
      • From: Carl West <email@hidden>
    • Re: closing MSWord files
      • From: Bryan <email@hidden>
  • Prev by Date: Re:
  • Next by Date: RE: folder of
  • Previous by thread: Re:
  • Next by thread: Re: closing MSWord files
  • Index(es):
    • Date
    • Thread