Summary: Formatting question
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