• 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: Scripting is for lazy people.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting is for lazy people.


  • Subject: Re: Scripting is for lazy people.
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 10 Sep 2001 18:21:02 -0700

On 9/9/01 7:36 PM, "Rachel Cogent" <email@hidden> wrote:

> Two questions:
> 1: How do I reduce these 2 lines to 1?
>
> set doFile to name of file bar of foo
> set insertName to text 4 thru 5 of doFile
>
Not sure why you'd want to. It reads very well as it is, assuming it's
actually in a Finder tell block.

tell application "Finder
set insertName to text 4 thru 5 of (get name of file "bar" of folder
"foo" of startup disk)

end tell

Or use the alias nomenclature: alias "My HD:foo:bar"

In some applications you have to use the explicit 'get' or else set to a
variable in order to evaluate a property of an element to something that ca
be further used.

>
> 2: Why do I spend 6 hours doing something with a script when I could have
> done it the hard way in 45 minutes?
> Hint: Don't say it's because I'm lazy!
>

You like solving puzzles.


--
Paul Berkowitz


References: 
 >Scripting is for lazy people. (From: Rachel Cogent <email@hidden>)

  • Prev by Date: why won't my file object work???
  • Next by Date: Reality Checked - Exists? = True (It does? Oh dear...)
  • Previous by thread: Scripting is for lazy people.
  • Next by thread: Re: Scripting is for lazy people.
  • Index(es):
    • Date
    • Thread