Try taking the " ' " out of the hard drive name, ie. re name the hard
drive to "BillsHD" instead of "Bill'sHD"
then change this line from:
open file "Bill'sHD:Users:billsteele:Desktop:foo.txt"
to:
open file "BillsHD:Users:billsteele:Desktop:foo.txt"
See if that works
if that's not particularly palatable then you could also try (in the script only):
open file "Bill\'sHD:Users:billsteele:Desktop:foo.txt"
But I don't know if the \ is the escape character in apple script, someone here will correct me if i'm wrong.
Dave.
On Mon, 2010-12-06 at 22:00 -0500, MACSCRPT automatic digest system
wrote:
> MHTML Document attachment
> > -------- Forwarded Message --------
> > Subject: No Subject
> > Date: Tue, 07 Dec 2010 13:06:06 +1000
> >
> > Topics of the day:
> >
> > 1. Opening in Tex-Edit Plus in Snow Leopard (5)
> I have a script that does some text processing, saves a file, then opens the file in Tex-Edit Plus. Since I upgraded to Snow Leopard that no longer works. Tex-Edit Plus just opens an empty window.
>
> So I turned on Record, used Tex-Edit to open a file. Got the same thing I already have in my script:
>
> tell application "Tex-Edit Plus"
> activate
> open file "Bill'sHD:Users:billsteele:Desktop:foo.txt"
> end tell
>
> But when I run the recorded script, it opens the same empty untitled window. (Note: Tex-Edit preferences are set to *not* open an empty window on activation.)
>
> This was in the new "Applescript Editor." I still have the old Script Editor, but it doesn't work in that either, and Script Editor tends to quit now and then.
>
> Tried the same procedure on another machine running Leopard, and it works properly.
>
> Suggestions?
>
> Bill Steele
> [log in to unmask]
> On Dec 6, 2010, at 2:36 PM, Bill Steele wrote:
>
> > I have a script that does some text processing, saves a file, then opens the file in Tex-Edit Plus. Since I upgraded to Snow Leopard that no longer works. Tex-Edit Plus just opens an empty window.
> >
> > So I turned on Record, used Tex-Edit to open a file. Got the same thing I already have in my script:
> >
> > tell application "Tex-Edit Plus"
> > activate
> > open file "Bill'sHD:Users:billsteele:Desktop:foo.txt"
> > end tell
> >
> > But when I run the recorded script, it opens the same empty untitled window. (Note: Tex-Edit preferences are set to *not* open an empty window on activation.)
> >
> > This was in the new "Applescript Editor." I still have the old Script Editor, but it doesn't work in that either, and Script Editor tends to quit now and then.
> >
> > Tried the same procedure on another machine running Leopard, and it works properly.
> >
> > Suggestions?
>
>
> Have you tried with posix paths or aliases?
>
> -Mark
> On Dec 6, 2010, at 4:57 PM, Mark Lively wrote:
>
> > On Dec 6, 2010, at 2:36 PM, Bill Steele wrote:
> >
> >> I have a script that does some text processing, saves a file, then opens the file in Tex-Edit Plus. Since I upgraded to Snow Leopard that no longer works. Tex-Edit Plus just opens an empty window.
> >>
> >> So I turned on Record, used Tex-Edit to open a file. Got the same thing I already have in my script:
> >>
> >> tell application "Tex-Edit Plus"
> >> activate
> >> open file "Bill'sHD:Users:billsteele:Desktop:foo.txt"
> >> end tell
> >>
> >> But when I run the recorded script, it opens the same empty untitled window. (Note: Tex-Edit preferences are set to *not* open an empty window on activation.)
> >>
> >> This was in the new "Applescript Editor." I still have the old Script Editor, but it doesn't work in that either, and Script Editor tends to quit now and then.
> >>
> >> Tried the same procedure on another machine running Leopard, and it works properly.
> >>
> >> Suggestions?
> >
> >
> > Have you tried with posix paths or aliases?
> >
> > -Mark
>
>
> Aliases yes, posix paths no. We'll try that tomorrow morning. But either way, what bugs me is that it won't play back what it recorded.
>
> Bill Steele
> [log in to unmask]
> On Dec 06, 2010, at 16:35, Bill Steele wrote:
> > Aliases yes, posix paths no. We'll try that tomorrow morning. But either way, what bugs me is that it won't play back what it recorded.
> ______________________________________________________________________
>
> Curious. I just tried it on 10.6.5, and it worked perfectly. I even created a file path with an apostrophe in it.
>
> --
> Chris=
> On Dec 6, 2010, at 3:48 PM, Tom Bender wrote:
>
> > Is it possible that the single quote in “Bill’sHD” is not ASCII? Does it change if TEP is already open when the script runs?
>
> It is ASCII, and no other script has ever cared, and no.
>
> But it turns out it did work with alias, once I found the right finicky syntax. You can't say "foo as alias." Has to be "alias foo."
>
> Apparently inconsistent with -- or at least fussier than -- Leopard and others preceding.
>
> Bill Steele
> [log in to unmask]
|