• 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: Sorting characters of the text - script doesn't work as expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting characters of the text - script doesn't work as expected


  • Subject: Re: Sorting characters of the text - script doesn't work as expected
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 26 May 2017 19:05:34 +0200

I found a typo in the original script.

Near the end we may read :
if RuPageCount ≤ 20 then
set RusDocPrice to RuPageCount * 3 --failure. Returns an initial value
else if PageCount > 20 then
set RusDocPrice to RuPageCount * 2 --failure. Returns an initial value
end if

It must be :
if RuPageCount ≤ 20 then
set RusDocPrice to RuPageCount * 3
else if RuPageCount > 20 then
set RusDocPrice to RuPageCount * 2
end if


In fact the three blocks of code calculating the prices may be simplified as:

if EnPageCount ≤ 20 then
set EnDocPrice to EnPageCount * 4
else
set EnDocPrice to EnPageCount * 3
end if
if LtPageCount ≤ 20 then
set LtDocPrice to LtPageCount * 3
else
set LtDocPrice to LtPageCount * 2
end if


if RuPageCount ≤ 20 then
set RusDocPrice to RuPageCount * 3
else
set RusDocPrice to RuPageCount * 2
end if


Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) vendredi 26 mai 2017 19:05:27



 _______________________________________________
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: Sorting characters of the text - script doesn't work as expected
      • From: ILJA SHEBALIN <email@hidden>
    • Re: Sorting characters of the text - script doesn't work as expected
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)

  • Prev by Date: Re: Sorting characters of the text - script doesn't work as expected
  • Next by Date: Re: Sorting characters of the text - script doesn't work as expected
  • Previous by thread: Re: Sorting characters of the text - script doesn't work as expected
  • Next by thread: Re: Sorting characters of the text - script doesn't work as expected
  • Index(es):
    • Date
    • Thread