• 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: ILJA SHEBALIN <email@hidden>
  • Date: Mon, 25 Jun 2018 02:55:24 +0300

Thank you very much Deivy, it finally worked. I also took set RecList command
for offending one and tried experimenting with placing it outside loops but
failed because I didn't consider forcing a counting variable into the loop
operation right after setting the list of records to records.
25.06.2018, в 0:33, Deivy Petrescu написал(а):

>
>
>> On Jun 24, 2018, at 16:20 , Nigel Garvey <email@hidden> wrote:
>>
>> 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
>
>
> Nigel
> Am I missing something?
>
> Why are the  lines
> set (contents of itemRef) to missing value —a problem here!
>
> and
>
> set RecList to every record of RecList
>
> needed?
> If you remove them the script is shorter and it works, probably faster then
> this.
>
> By the way, congrats on the victory  :-)
>
>
> Deivy Petrescu
> email@hidden
>
>
>
> _______________________________________________
> 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

 _______________________________________________
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

References: 
 >Re: AppleScript script unable to respond to a script statement correctly (From: Nigel Garvey <email@hidden>)
 >Re: AppleScript script unable to respond to a script statement correctly (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: 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 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