AppleScript less than number or greater than number

XQLRSZ

I am having an error in AppleScript when I use less than or greater than operators consecutively. I probably didn't explain that very well, so I will post the code.

**set good to false**

**repeat until good = true**
set oneTen to the text returned of (display dialog "Pick a number from 1 through 10" default answer "" buttons {"OK"} default button 1) as number

if oneTen is less than 0 then
    display dialog "below" buttons {""} default button 1
else if oneTen is greater than 10 then
    display dialog "above" buttons {""} default button 1
else
    set good to true
end if
**end repeat**

I am trying to take the input from the prompt, and keep the user from entering anything below 0 or above 10. Could you post some code to do this well?

I want something similar to this.

**set oneTen to the text returned of (display dialog "Pick a number from 1 through 10" default answer "" buttons {"OK"} default button 1) as number**

**if oneTen is less than 0 or greater than 10 then**

**-- make them do the prompt again**

**end if**
adayzdone

Try:

repeat
    set oneTen to the text returned of (display dialog "Pick a number from 1 through 10" default answer "" buttons {"OK"} default button 1) as number

    if oneTen is less than 0 then
        display dialog "below" buttons {""} default button 1
    else if oneTen is greater than 10 then
        display dialog "above" buttons {""} default button 1
    else
        exit repeat
    end if
end repeat

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Remove lines containing a number less than/greater than a limit?

From Dev

Greater than and Less than not working correctly with random number in Python

From Dev

how to get data greater than and less than a number in codeigniter

From Dev

excel roundup if number is 2 or greater and/or less than 2

From Dev

A number is both greater and less than another in a windows batch file

From Dev

Number less than 0

From Dev

Programming. AppleScript Editor. Greater Than, Less Than in If statements

From Dev

Match number if greater than zero

From Dev

Check if number is greater than 4

From Dev

greater than condition with number and decimal

From Dev

RegEx for number greater than 1120

From Dev

CSS rule for number greater than

From Dev

SSRS is month greater than number

From Dev

I have a number and I would like to get the closest number less than and closest number greater than inside a jquery array

From Java

Find largest continuous interval such that all number between starting and ending are greater than starting and less than ending

From Dev

How to specify a validation rule in Yii2 which will be greater than or less than of a specific number or value?

From Dev

How to write a condition if the number is equal, greater than two digits, or less than two digits

From Dev

What is the shortest way to determine if one number is greater than, less than, or equal to another?

From Dev

Number of multiples less than the max number

From Dev

number of lines with number of words less than 5

From Dev

Greater than or Less than equal to

From Dev

if greater than or less than and zero

From Dev

Error converting data type nvarchar to float when checking greater or less than a number

From Dev

How to count number of cells greater or less than 0 (zero) between two dates in Excel?

From Java

Laravel: Validating a number greater than zero is failing

From Dev

Cassandra replication factor greater than number of nodes

From Dev

CSS rule for classes with number greater than

From Dev

Find number greater than given parameter in regex

From Dev

Finding a number greater than x in a range

Related Related

  1. 1

    Remove lines containing a number less than/greater than a limit?

  2. 2

    Greater than and Less than not working correctly with random number in Python

  3. 3

    how to get data greater than and less than a number in codeigniter

  4. 4

    excel roundup if number is 2 or greater and/or less than 2

  5. 5

    A number is both greater and less than another in a windows batch file

  6. 6

    Number less than 0

  7. 7

    Programming. AppleScript Editor. Greater Than, Less Than in If statements

  8. 8

    Match number if greater than zero

  9. 9

    Check if number is greater than 4

  10. 10

    greater than condition with number and decimal

  11. 11

    RegEx for number greater than 1120

  12. 12

    CSS rule for number greater than

  13. 13

    SSRS is month greater than number

  14. 14

    I have a number and I would like to get the closest number less than and closest number greater than inside a jquery array

  15. 15

    Find largest continuous interval such that all number between starting and ending are greater than starting and less than ending

  16. 16

    How to specify a validation rule in Yii2 which will be greater than or less than of a specific number or value?

  17. 17

    How to write a condition if the number is equal, greater than two digits, or less than two digits

  18. 18

    What is the shortest way to determine if one number is greater than, less than, or equal to another?

  19. 19

    Number of multiples less than the max number

  20. 20

    number of lines with number of words less than 5

  21. 21

    Greater than or Less than equal to

  22. 22

    if greater than or less than and zero

  23. 23

    Error converting data type nvarchar to float when checking greater or less than a number

  24. 24

    How to count number of cells greater or less than 0 (zero) between two dates in Excel?

  25. 25

    Laravel: Validating a number greater than zero is failing

  26. 26

    Cassandra replication factor greater than number of nodes

  27. 27

    CSS rule for classes with number greater than

  28. 28

    Find number greater than given parameter in regex

  29. 29

    Finding a number greater than x in a range

HotTag

Archive