• 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
Summary: Formatting question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Summary: Formatting question


  • Subject: Summary: Formatting question
  • From: Chris Waldrip <email@hidden>
  • Date: Fri, 20 Apr 2007 15:52:07 -0400

Mark Reed was kind enough to point out my simple mistake, my second line should read...
set DNGnumber to text returned of result as number


As for my second question, the easiest method I've found is to use scutil...
do shell script "scutil --set ComputerName \"" & machineName & "\"" with administrator privileges


Thanks,
-Chris

On Apr 20, 2007, at 9:49 AM, Chris Waldrip wrote:

Two questions:
- I'm trying to take a number entered by the user, and prefix it with specific text depending on the size of that number.


- Eventually, I haven't gotten this far yet, I'd like to take that prefix and number and use that for the machine's sharing name.

Here's the part of the script I've written for obtaining the number and checking which prefix to use. At this point I just wanted to see the results so they're not being applied to a new variable yet. The first problem is that, as run from Script Editor, it doesn't display the actual value entered by the user (for me it's returning the number 3 for some reason, ymmv).

-Chris

display dialog "Enter your DNG Kit number" & return default answer "" buttons {"Next", "Cancel"} default button 1 giving up after 30
set DNGnumber to number of result
if DNGnumber is false then end


display dialog "DNGnumber is " & DNGnumber

if DNGnumber is less than 10 then
	display dialog "DNG00" & DNGnumber
else if DNGnumber is less than 100 then
	display dialog "DNG0" & DNGnumber
else
	display dialog "DNG" & DNGnumber
end if

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Summary: Formatting question
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Formatting question (From: Chris Waldrip <email@hidden>)

  • Prev by Date: Re: Quark crash with duplicate command
  • Next by Date: Re: Summary: Formatting question
  • Previous by thread: Re: Formatting question
  • Next by thread: Re: Summary: Formatting question
  • Index(es):
    • Date
    • Thread