• 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: Need your thoughts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need your thoughts


  • Subject: Re: Need your thoughts
  • From: Nigel Garvey <email@hidden>
  • Date: Wed, 23 Feb 2011 09:59:42 +0000

Michelle Steiner wrote on Tue, 22 Feb 2011 23:04:08 -0700:

>On Feb 22, 2011, at 9:28 PM, louie wrote:

>> Can I write a script that will have a dialog where I can type in the name
>>and the phone number then press the ok button. After pressing the OK button
>>I want the script to produce a application that is the name of the person.

>The following script almost does what you want; however, it saves the
>script application as a classic app, which won't run in Snow Leopard.
>
>set theName to the text returned of (display dialog "enter the name"
>default answer "")
>set theNUmber to the text returned of (display dialog "enter the phone
>number" default answer "")
>-- you might want to perform error checking for the phone number to make
>sure it's numeric and has the right number of digits
>
>tell application "AppleScript Editor"
>	set theDoc to make new document with properties {contents:"the script goes
>here"}
>	save theDoc as "application bundle" in file ((path to desktop as text) &
>theName)
>end tell

Shane Stanley wrote on Wed, 23 Feb 2011 17:11:01 +1100:

>It will give you a Cocoa native applet if you add the extension:

I've found the same to be true when using 'store script', which saves
having to go through AppleScript Editor:

  on makeApplet(theName, theNumber)
    script o
      property callee : theName
      property tel : theNumber

      -- Your code here. This is just a demo.
      display dialog callee & return & tel
    end script

    store script o in file ((path to desktop as text) & theName & ".app")
  end makeApplet

  set theName to the text returned of (display dialog "enter the name"
default answer "")
  set theNumber to the text returned of (display dialog "enter the phone
number" default answer "")
  -- you might want to perform error checking for the phone number to
make sure it's numeric and has the right number of digits

  makeApplet(theName, theNumber)


NG

 _______________________________________________
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: Need your thoughts
      • From: Cameron Knowlton <email@hidden>
  • Prev by Date: Re: Need your thoughts
  • Next by Date: Re: Need your thoughts
  • Previous by thread: Re: Need your thoughts
  • Next by thread: Re: Need your thoughts
  • Index(es):
    • Date
    • Thread