Re: Save as
Re: Save as
- Subject: Re: Save as
- From: Victor Yee <email@hidden>
- Date: Wed, 20 Dec 2000 08:00:06 -0500
On 20/12/00, Peter Mathiessen wrote:
>
I have stumbled on a rather strange problem I hope anyone here can solve.
>
>
I have made a script that among many other things saves an tex-edit file,
>
this works on at least two computers I have on my work, but then I tried it
>
at home it wouldnt work. "cant make some data into the expected type".
>
>
Im runnig MacOS 9.04 on all my computers, both at home and work and have the
>
same version of Tex-Edit.
>
>
What is wrong?
>
>
The script:
>
tell application "Tex-Edit Plus"
>
activate
>
save window 1 in "Macintosh HD:temp_folder:one:" as "TEXT"
>
close window 1 saving no
>
end tell
Hello Peter,
When saving, Tex-Edit expects a file specification, such as
save window 1 in file "Macintosh HD:thisFile"
(Note the keyword "file" before the path string.)
Instead, what you've provided in this case is a location, i.e. a folder, as evidenced by the colon (:) at the end of your path string.
>
save window 1 in "Macintosh HD:temp_folder:one:" <-- ends with a colon
Also, you may be experiencing a string to file spec coercion resulting from a scripting addition on your at-work computers that your at-home computer doesn't have. (perhaps Jon's Commands?)
If you wish to save in a certain folder, you could try something like this.
set folderPathString to "Macintosh HD:temp_folder:one:"
tell application "Tex-Edit Plus"
activate
set thisNameString to name of window 1
save window 1 in file (folderPathString & thisNameString) as "TEXT"
close window 1 saving no
end tell
Else, if your intention was to save in a file named "one"
tell application "Tex-Edit Plus"
activate
save window 1 in file "Macintosh HD:temp_folder:one" as "TEXT"
close window 1 saving no
end tell
--
Victor
References: | |
| >Save as (From: Peter Mathiessen <email@hidden>) |