Re: Microsoft Word - save syntax
Re: Microsoft Word - save syntax
- Subject: Re: Microsoft Word - save syntax
- From: David Wignall <email@hidden>
- Date: Thu, 12 Jun 2003 23:10:36 +1200
on 12/6/2003 3:29 AM, Ruby Madraswala at email@hidden wrote:
>
Property hotfolder: "Macintosh HD:Final:"
>
>
Tell application "Finder"
>
Set flist to every file in folder hotfolder
>
Repeat with curfile in flist
>
Set dnm to curfile as string
>
Tell application "Microsoft Word"
>
Activate
>
Open file dnm
>
Save file dnm as dosText
>
(error message "The variable dosText is not defined"
>
Or
>
Do Visual Basic "activeDocument. SaveAs Filename:=dnm,
>
FileFormat:=wdFormattoDOSText"
>
(error message "ambiguous name detected: TmpDDE)
>
Close ActiveDocument
>
End tell
>
End repeat
>
End tell
Too tired to think about the AppleScript way but your 'do Visual Basic'
line should be
do Visual Basic "activeDocument. SaveAs Filename:=\"" & dnm & "\",
FileFormat:=wdFormatDOSText"-- 1 line
'Do Visual Basic' requires a string that is the VBA procedure. When you pass
a variable that gets its' value from the AS side the value becomes part of
the string and in this case must be inside quotes when the VBA procedure is
run. Also your file format enumeration was misspelt.
Do you really need to activate Word?
<pause>
You know, I don't think you can do what you want in Word/AppleScript. If you
chief concern was line endings you could manipulate the file directly
<shrug>
--
Dave
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.