Re: I broke AppleScript
Re: I broke AppleScript
- Subject: Re: I broke AppleScript
- From: Deivy Petrescu <email@hidden>
- Date: Wed, 25 Jan 2017 14:00:25 -0500
> On Jan 25, 2017, at 13:51 , Jacopille, David <email@hidden> wrote:
>
> Yvan,
>
> This also fails with the same compile error: Can’t get 4 of my_list. Access not allowed.
>
> tell me to set item 4 of my_list to 10
>
> Deivy,
>
> In practice, you need a ‘set item’ command to change geometric bounds in InDesign, which are stored as a four number list. E.g.
>
> set item 4 of geometric bounds of myBoxObject to 144
>
> Adobe should not have made ‘item’ a reserved word starting in InDesign 11.4.1.102 because it’s an AppleScript reserved word.
Should! I agree, but you and I versus Adobe, you know who wins.
To fix it, you have to do something like this:
set my_list to {1, 2, 3, 4}
tell application id “com.adobe.indesign"
set my_list to setSomeItemInAList(4,my_list,10)
…
end tell
on setSomeItemInAList(x,lista,valor)
set item x of lista to valor
return lista
end
So set item is out of the indesign tell block.
>
> Thanks,
> Dave
>
> From: <applescript-users-bounces+djacopille=email@hidden> on behalf of Yvan KOENIG <email@hidden>
> Date: Wednesday, January 25, 2017 at 1:35 PM
> To: AppleScript Users <email@hidden>
> Subject: Re: I broke AppleScript
>
>
>> Le 25 janv. 2017 à 19:30, Jacopille, David <email@hidden> a écrit :
>>
>> Has anyone seen this problem? Basic stuff like, set item x…, stopped working at compile time.
>>
>> set my_list to {1, 2, 3, 4}
>> set item 4 of my_list to 5 -- WORKS
>> tell application id "com.adobe.indesign"
>> set item 4 of my_list to 10 -- FAILS
>> end tell
>>
>> AppleScript Compile Error (on line 4): Can’t get 4 of my_list. Access not allowed.
>>
>> OS X 10.11.6
>> InDesign 11.4.1.102
>> All OSAX deleted and machine rebooted
>>
>> For reference, the same code works great on a machine with 10.9.5 and InDesign 11.3.0.34
>>
>> I’d love to downgrade InDesign to a specific point version but I see no way to do that under Adobe’s new subscription model.
>>
>> Any ideas?
>>
>> Thanks,
>> Dave
>
>
>
> If you really need to put the instruction in a tell application Adobe block, try:
>
> set my_list to {1, 2, 3, 4}
> set item 4 of my_list to 5 -- WORKS
> tell application id "com.adobe.indesign"
> tell me to set item 4 of my_list to 10 -- FAILS
> end tell
>
> Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) mercredi 25 janvier 2017 19:35:24
>
>
> MFS Email system made the following annotation
> ---------------------------------------------------------------------------------------------------------------------------------------
> This email communication and any attachments may contain proprietary, confidential, or privileged information. If you are not the intended recipient, you are hereby notified that you have received this email in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. The sender does not waive confidentiality or any privilege by mistransmission. If you have received this email in error, please notify the sender immediately, delete this email, and destroy all copies and any attachments. _______________________________________________
> 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
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