• 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: I broke AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I broke AppleScript


  • Subject: Re: I broke AppleScript
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 25 Jan 2017 20:39:06 +0100


Le 25 janv. 2017 à 20:00, Deivy Petrescu <email@hidden> a écrit :


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



When we have such kind of conflict when using ASObjC we may get rid of it enclosing the varname between vertical bars  |item|.
Is it working in this case ?

Some days ago, I faced such problem in a script driving Mail.

I used an awful tip :

using terms from application "Mail"
on perform mail action with messages theMessages for rule SAVE_ATTACHMENT_SIERRA
# The instruction compiling wrongly
-- tell me to set attachmentsFolder to (path to documents folder as text) & "4attachments:"
tell me to set attachmentsFolder to (path to documents folder rule type rich text) & "4attachments:" # Awful result of the compilation of the instruction commented above
tell application "Finder"
# Enclosing it in a tell Finder block is awful but it works
tell me to set attachmentsFolder to (path to documents folder as text) & "4attachments:"
end tell
end perform mail action with messages
end using terms from


Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) mercredi 25 janvier 2017 20:38:49


 _______________________________________________
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: 
 >I broke AppleScript (From: "Jacopille, David" <email@hidden>)
 >Re: I broke AppleScript (From: Yvan KOENIG <email@hidden>)
 >Re: I broke AppleScript (From: "Jacopille, David" <email@hidden>)
 >Re: I broke AppleScript (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: I broke AppleScript
  • Next by Date: Re: I broke AppleScript
  • Previous by thread: Re: I broke AppleScript
  • Next by thread: Re: I broke AppleScript
  • Index(es):
    • Date
    • Thread