• 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: Checking if script is run from login items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking if script is run from login items


  • Subject: Re: Checking if script is run from login items
  • From: Ed Stockly via AppleScript-Users <email@hidden>
  • Date: Sun, 23 Aug 2020 10:40:05 -0700

Just in case it ever matters, there are numerous ways to get an integer from a
real in appleScript and, depending on the number, no two ways are exactly alike.

In other words, depending on the number, no two methods always result in the
same integer.

Here’s an illustration:

set theCount to 0
set theResults to {}
set AppleScript's text item delimiters to {", "}
repeat 10 times
        set x to random number from -10 to 10.5
        set theDiv to x div 1
        set theCoerce to x as integer
        set theDivide to x / 1
        set theRoundATIS to round theDivide ¬
                rounding as taught in school
        set theRoundDown to round theDivide ¬
                rounding down
        set theRoundUp to round theDivide ¬
                rounding up
        set theRoundNearest to round theDivide ¬
                rounding to nearest

        set theRoundZero to round theDivide ¬
                rounding toward zero
        set theCount to theCount + 1
        set thisGo to {theCount & ":" & x, ¬
                "Div: " & theDiv, ¬
                "Coerce: " & theCoerce, ¬
                "Division: " & theDivide, ¬
                "Round (School): " & theRoundATIS, ¬
                "Round (Up): " & theRoundUp, ¬
                "Round (Down): " & theRoundDown, ¬
                "Round (Nearest): " & theRoundNearest, ¬
                "Round (Zero): " & theRoundZero ¬
                }
        set the end of theResults to thisGo as text
        log thisGo as text
end repeat

set AppleScript's text item delimiters to {return}

return theResults as text


 _______________________________________________
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

  • Prev by Date: Re: Checking if script is run from login items
  • Next by Date: Re: Checking if script is run from login items
  • Previous by thread: Re: Checking if script is run from login items
  • Next by thread: [ANN] PDF title detect and rename tool "Rename by contents" now on sale at Mac App Store
  • Index(es):
    • Date
    • Thread