• 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: Recent changes in script behaviour? (OS X)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recent changes in script behaviour? (OS X)


  • Subject: Re: Recent changes in script behaviour? (OS X)
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 28 Jun 2002 07:56:52 -0700

On 6/28/02 3:36 AM, "Mr Tea" <email@hidden> wrote:

> At least one of my scripts has stopped working since I upgraded to OS X
> 10.1.5 and AS 1.8.3.
>
> This simple script toggles the active state of a freeware utility that
> displays all the characters available in a font. It starts by checking
> whether or not the utility is running, and originally began thus:
>
> tell application "Finder"
> if "PickChar" is in name of every process then
>
> That used to work just fine, but when I tried to run it a few moments ago, I
> got an error telling me that the Finder couldn't get the name of every
> process. The script was restored when I changed that to this:
>
> Tell application "Finder" to set theProcs to name of every process
> If "PickChar" is in theProcs then
>
> What happened to break the original script?
>

First of all, I think you'll find that this will work:

tell application "Finder"
if "PickChar" is in (get name of every process) then


It's one of those things that seems to need the evaluation of an explicit
'get' or an intermediary variable. What changed things? Not AS 1.8.3, I
don't think, but OS X. Before you joined in here, we actually lost 'process'
entirely back in OS 10.0.x. I'm trying to recall if it returned with 10.1 (I
think so) or 10.1.2, but it was around that time: i think it was AS 1.6 in
OS 10.1. It turns out that - at the moment - it really belongs to an
application called 'System Events'. but we've been warned that it may move
to yet another home sometime soon and that the Finder will always know where
to find 'process' and other 'legacy' terms.

However, the underlying implementation has apparently changed dramatically.
Somewhere in the shuffle, the Finder's implicit 'get' got lost or forgotten.
Generally speaking, the Finder has a lot of nice, friendly coercions and
implementations to make things more relaxed for scripts, which many other
apps do not have. I'm quite used to needing that explicit 'get' or a
variable for application properties in Entourage and Outlook Express before
it ('selection', 'current messages' and a few other things require it).

'every' (the plural form) in the Finder seems to have a few other quirks at
the moment. We've all noticed that 'first' just seems to mean 'every' , or
at least produces a list rather than a single item. I imagine we'll get some
of those missing coercions back when they have time to do a bit of
cleaning-up. 'name of every process' would be nice to have back without the
need for an explicit 'get'. But - especially if you'd been around when it
didn't exist in X at all - it sure is nice to have it at all, even if you
have to go 'get' it.
--
Paul Berkowitz
_______________________________________________
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.

References: 
 >Recent changes in script behaviour? (OS X) (From: Mr Tea <email@hidden>)

  • Prev by Date: Re: Problem with iTunes & AppleScript (1.8.3)
  • Next by Date: Re: puzzled with script syntax error
  • Previous by thread: Recent changes in script behaviour? (OS X)
  • Next by thread: What's the easy way to do this? (convert string to num without excess chars)
  • Index(es):
    • Date
    • Thread