• 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: Slow Command in Snow Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow Command in Snow Leopard


  • Subject: Re: Slow Command in Snow Leopard
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 07 Mar 2010 18:23:30 -0600

On Mar 7, 2010, at 4:47 PM, Mark J. Reed wrote:

Might I suggest something like this?

set filenames to paragraphs of (do shell script "ls -1d " & (quoted
form of posix path of prefsRef) & "/" & prefIdent & "*")

Following your suggestion, I replaced the offending line with a call to this handler.

on getItemsStarting(prefIdent, prefsRef)
set AppleScript's text item delimiters to {return}
quoted form of (POSIX path of prefsRef)
try
do shell script "ls -1dp " & the result & prefIdent & "*"
on error
return {}
end try
set pathList to text items of the result
--
set aliasList to {}
repeat with i from 1 to (count items of pathList)
item i of pathList
if last character of the result is not "/" then
(POSIX file the result) as alias
set aliasList to (aliasList & {the result})
end if
end repeat
return aliasList
end getItemsStarting --------------------------------

Oooooooooooooooo! (I learned to spell with Cheerios.)
I've got my speed back!

The man page for 'ls' does not include any explanation for the '& "/" & prefIdent & "*"'.
The "*" probably tells 'ls' to find names beginning.
What is the "/" for?
(I was sure I would find the answer when I removed it, but it worked anyway.)

And more importantly ...
Why can't Snow Leopard do this?
The fact that a 'do shell script ...' works indicates a bug here.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Slow Command in Snow Leopard
      • From: "Mark J. Reed" <email@hidden>
    • Re: Slow Command in Snow Leopard
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Slow Command in Snow Leopard (From: Luther Fuller <email@hidden>)
 >Re: Slow Command in Snow Leopard (From: Michelle Steiner <email@hidden>)
 >Re: Slow Command in Snow Leopard (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Big bug in Excel Applescript?
  • Next by Date: Re: Slow Command in Snow Leopard
  • Previous by thread: Re: Slow Command in Snow Leopard
  • Next by thread: Re: Slow Command in Snow Leopard
  • Index(es):
    • Date
    • Thread