• 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: AppleScript script unable to respond to a script statement correctly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript script unable to respond to a script statement correctly


  • Subject: Re: AppleScript script unable to respond to a script statement correctly
  • From: Nigel Garvey <email@hidden>
  • Date: Sun, 24 Jun 2018 21:20:22 +0100

ILJA SHEBALIN wrote on Sun, 24 Jun 2018 05:07:14 +0300:

>set RecList to {{ParagraphText:"On 18 Jun 2018, at 3:28 pm, Ilya
Shebalin
><email@hidden> wrote:", ParagraphPosition:1},
>{ParagraphText:"That's how the as \"class utf8\" compiles in
>ScriptDebugger:", ParagraphPosition:3}, {ParagraphText:"",
>ParagraphPosition:4}, {ParagraphText:"Type this into a Script Debugger
>window:", ParagraphPosition:5}, {ParagraphText:"", ParagraphPosition:6},
>{ParagraphText:"current date", ParagraphPosition:7},
>{ParagraphText:"Compile, then go to the View Menu and choose Show Raw
>(Chevron) Syntax, and compile again. What do you see now?",
>ParagraphPosition:9}, {ParagraphText:"", ParagraphPosition:2},
>{ParagraphText:"", ParagraphPosition:8}}
>set NewRecList to {}
>repeat until RecList is {}
>       repeat with itemRef in RecList
>               if ParagraphPosition of contents of itemRef = (count RecList)
> then
>                       "log (count RecList):"
>                       log (count RecList)
>                       "log ParagraphPosition of contents of itemRef = (count
> RecList):"
>                       log (ParagraphPosition of contents of itemRef = (count
> RecList))
>                       set end of NewRecList to contents of itemRef
>                       set (contents of itemRef) to missing value --a problem
> here!
>                       "log (contents of ItemRef):"
>                       log (contents of itemRef)
>                       set RecList to every record of RecList
>                       "log RecList:"
>                       log RecList
>                       "log (count RecList):"
>                       log (count RecList)
>               end if
>       end repeat
>end repeat

>Tell me please what mistake I made.

Further to Shane's reply, the line 'set RecList to every record of
RecList' should go between the two 'end repeat' lines. And where it is
at the moment, you should ideally have 'exit repeat'.

  set RecList to {{ParagraphText:"On 18 Jun 2018, at 3:28 pm, Ilya Shebalin
<email@hidden> wrote:", ParagraphPosition:1}, {ParagraphText:"That's
how the as \"class utf8\" compiles in ScriptDebugger:", ParagraphPosition:3},
{ParagraphText:"", ParagraphPosition:4}, {ParagraphText:"Type this into a
Script Debugger window:", ParagraphPosition:5}, {ParagraphText:"",
ParagraphPosition:6}, {ParagraphText:"current date", ParagraphPosition:7},
{ParagraphText:"Compile, then go to the View Menu and choose Show Raw (Chevron)
Syntax, and compile again. What do you see now?", ParagraphPosition:9},
{ParagraphText:"", ParagraphPosition:2}, {ParagraphText:"",
ParagraphPosition:8}}
  set NewRecList to {}
  set RecListLen to (count RecList)
  repeat until RecListLen is 0
    repeat with itemRef in RecList
      if ParagraphPosition of itemRef = RecListLen then
        set end of NewRecList to contents of itemRef
        set (contents of itemRef) to missing value --a problem here!
        exit repeat
      end if
    end repeat
    set RecList to every record of RecList
    set RecListLen to RecListLen - 1
  end repeat

  return {List1:NewRecList, List2:RecList}


NG

 _______________________________________________
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: AppleScript script unable to respond to a script statement correctly
      • From: Deivy Petrescu <email@hidden>
  • Prev by Date: Re: [applescript] AppleScript script unable to respond to a script statement correctly
  • Next by Date: Re: AppleScript script unable to respond to a script statement correctly
  • Previous by thread: Re: [applescript] AppleScript script unable to respond to a script statement correctly
  • Next by thread: Re: AppleScript script unable to respond to a script statement correctly
  • Index(es):
    • Date
    • Thread