• 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
Re: Do I need a newer version of Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do I need a newer version of Applescript


  • Subject: Re: Do I need a newer version of Applescript
  • From: email@hidden
  • Date: Sat, 8 Dec 2001 02:39:11 EST

Two responses (and one solution) follow....

In a message dated 12/7/01 7:51:45 PM, John W Baxter wrote:

>At 23:23 -0500 12/6/2001, email@hidden wrote:
>>I tried to upgrade MacOS 9.2.1 on my G4 to 9.2.2 and it choked. Somehow I
>>didn't get Script Editor 1.7 out of the process, so I'm thinking the upgrade
>>was incomplete. I've tried re-upgrading several times and it still chokes,
so
>>I think I have a corrupted system now. Bummer.
>
>Have you moved Script Editor out of what Apple thinks is the proper place?
>This could well be one of their updaters which doesn't look around for the
>thing to be replaced, and doesn't put in a new one if there isn't an old
>one.

Yup, that was it. I routinely rename certain apps to include the version
number (disk copy, disk first aid, drive setup, script editor to name a few).
I wonder how many updates I've cheated myself out of by doing this? : )

....and Brian Johnson suggested (in regards to ":" as alias being broken in
9.2.2/1.7):

>I have the same need, and routinely do this with
>
> set x to path to me as text
> set oldones to AppleScript's text item delimiters
> set AppleScript's text item delimiters to ":"
> set x to text items 1 through -2 of x
> set sys_root to (x as string) & ":"
> set AppleScript's text item delimiters to oldones
> set x to sys_root & "script.helpers"
> set helpers to load script file x
>
>then, later on, you use them with
>
> tell helpers to do_something()

Blech, yuk, ptooey!* That's how I used to do it and why I loved it when
Motoyuki Tanaka (who I publically hold in great regard and admiration in the
hopes that he will update his wonderful osax to OSX) came up with ":" as
alias.

However, I have wonderful news. I, the scripter who came up with the one line
no osax workaround for coercing styled text to a string (set plainString to
styledText as unicode text as string), have found a solution (hopefully not
merely a "workaround")!

set pathToMyFolder to ":" as file specification as string

Interestingly, this allows an added efficiency:

set pathToHandlerLibrary to ":handlerlibrary" as file specification as
string

This works even if the file doesn't exist, which is, I believe, correct
behavior. It doesn't work with ":handlerlibrary" as alias, even under 9.1,
which is as expected. You can't alias a non-existent file. And....<drum roll
please>.... IT WORKS CORRECTLY WITH OSX!!! <fireworks, trumpets, public
acclaim>

Sadly, it does not appear to be reliably backwards compatible to MacOS 8.x.
But that's OK since ":" as alias still works there. Also, I get some
interesting results when run from the OSX Script Editor (as opposed to when
saved as an applet, where it behaves correctly, and which is the only
circumstance in which I would ever use such a construct anyway).

Chris Nebel, if you mess with this one I'll come to Cupertino myself and whip
you with a wet noodle! : )

* No part of this message is intended to be disparaging to Brian Johnson, who
very kindly submitted good code which works in all OS versions from 8.1 to
10.1.1, but which is just too darn cumbersome for my tastes. Thanks Brian.

Jeff Baumann
email@hidden
www.linkedresources.com


  • Prev by Date: Re: Scripts no longer work in 9.2.2
  • Next by Date: Re: Scripts no longer work in 9.2...
  • Previous by thread: AS Studio
  • Next by thread: Re: Do I need a newer version of Applescript
  • Index(es):
    • Date
    • Thread