• 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 differences ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: script differences ?


  • Subject: Re: script differences ?
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 11 Oct 2015 16:33:37 +0200


Le 2015/10/11 à 16:21, Steve Mills <email@hidden> a écrit :

On Oct 11, 2015, at 08:06, Yvan KOENIG <email@hidden> wrote:

#1 I would move the instruction triggering display dialog out of the tell application block because "display dialog" is not a "Reminders" command.

Depending on how the script gets executed, "display dialog" and the like *need* to be inside a "tell app" block, otherwise you have no control over which app it will appear in. It doesn't matter that it's not a command implemented by the app. It still works just fine.

Steve via iPad

I never encapsulate display dialog in the driven application.
To be sure that the dialog appears at front I use:

tell application "SystemUIServer" to display dialog…

This app is designed to drive the User Interface so it's the neater one to fit our needs.
In the Original codes, there were not only display dialog but path to resource and path to application which were encapsulated in a tell application "System Events" block.

In what the asker posted, there is no reason to encapsulate display dialog.

If what was posted is a subset of a longer script, I would use:

path to resource "Reminders.icns" in bundle (path to application "Reminders")

tell application "SystemUIServer" to set reminTitle to text returned of (display dialog "Create a new reminder" default answer "" buttons {"Cancel", "Create"} default button 2 cancel button 1 giving up after 20 with icon result)
if reminTitle > "" then
tell application "Reminders"
make new reminder with properties {name:reminTitle}
end tell
end if

Yvan KOENIG (VALLAURIS, France) dimanche 11 octobre 2015 16:33:25



 _______________________________________________
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 differences ?
      • From: Luther Fuller <email@hidden>
References: 
 >Rép: script differences ? (From: Yvan KOENIG <email@hidden>)
 >Re: Rép: script differences ? (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Rép: script differences ?
  • Next by Date: Re: script differences ?
  • Previous by thread: Re: Rép: script differences ?
  • Next by thread: Re: script differences ?
  • Index(es):
    • Date
    • Thread