• 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: Script Editor Bug Tracking Open Windows?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Editor Bug Tracking Open Windows?


  • Subject: Re: Script Editor Bug Tracking Open Windows?
  • From: Jon Pugh <email@hidden>
  • Date: Thu, 08 Mar 2018 22:24:58 -0800

On Mar 8, 2018, at 9:42 PM, Shane Stanley <email@hidden> wrote:
>
> On 9 Mar 2018, at 4:28 pm, Jonathan Levi <email@hidden
> <mailto:email@hidden>> wrote:
>
>>      do shell script "open $HOME/Desktop/" & fname
>>      logWindowCountsTwoWays(fname)
>
>
> You're possibly only using this code for testing, but it's generally a very
> bad idea. The "do shell script" command will return as soon as the open
> command has been issued, so it's a matter of luck whether the file will
> actually be open before the next statement in your script is executed. It's
> recipe for intermittent errors.

Here’s a better script snippet:

--do shell script "open $HOME/Desktop/" & fname
tell application "Finder" to open folder fname of desktop

Enjoy.

Jon

Attachment: signature.asc
Description: Message signed with OpenPGP

 _______________________________________________
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: Script Editor Bug Tracking Open Windows?
      • From: Shane Stanley <email@hidden>
References: 
 >Script Editor Bug Tracking Open Windows? (From: Jonathan Levi <email@hidden>)
 >Re: Script Editor Bug Tracking Open Windows? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Script Editor Bug Tracking Open Windows?
  • Next by Date: Re: Script Editor Bug Tracking Open Windows?
  • Previous by thread: Re: Script Editor Bug Tracking Open Windows?
  • Next by thread: Re: Script Editor Bug Tracking Open Windows?
  • Index(es):
    • Date
    • Thread