This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Pages: 1 - Last Post: 6 Aug 21, 20:09 Last Post By: RobM Threads: [ Previous | Next ]
RobM

Posts: 3,838
Registered: 4-Aug-2006
Code fails after operation aborted.
Posted: 6 Aug 21, 01:02
 
  Click to reply to this thread Reply
In init.bsh I get the AlbumObjectProperties of a folder's representing image. I then make a new image and put its width and height to the vars map and put the updated vars map to the object's properties. Later on I read the width and height using ao.getVars().get("width").

It all works, until in init.bsh I throw an 'OperationAbortedException' for an unsupported file being in the project. Having excluded or removed the offending file, when I do a make album the saved properties are now reported as null. To make the project again I need to reload it.

It is very repeatable.
JeffTucker

Posts: 8,219
Registered: 31-Jan-2006
Re: Code fails after operation aborted.
Posted: 6 Aug 21, 01:04   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
A proper skin would exclude the unsupported objects automatically.

Cf. "fringe case." ;)
davidekholm

Posts: 3,478
Registered: 18-Oct-2002
Re: Code fails after operation aborted.
Posted: 6 Aug 21, 09:23   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Are you calling .save() on the AlbumObjectProperties after changing its properties?

(There are two variants, save() and save(boolean). save() preserves the last modified date and save(boolean) lets you decide whether to preserve the last modified date or not.
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: Code fails after operation aborted.
Posted: 6 Aug 21, 09:44   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
A proper skin would exclude the unsupported objects automatically.

Cf. "fringe case." ;)

A wise sage once said 'Don't do me any favours' ;) So, before excluding unsupported objects I ask if they want them excluded or not. If you don't ask, and don't reset those you exclude, the user ends up with all such object's excluded. If they decide to switch skins it leaves their project in disarray.
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: Code fails after operation aborted.
Posted: 6 Aug 21, 10:05   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Are you calling .save() on the AlbumObjectProperties after changing its properties?

(There are two variants, save() and save(boolean). save() preserves the last modified date and save(boolean) lets you decide whether to preserve the last modified date or not.

Yes, I used .save().

I have deleted jAlbum and downloaded it again, did a core update to get to 24.1.1 and then a beta core update (texts properties). It is now working as it should, so I've marked it as answered.
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: Code fails after operation aborted.
Posted: 6 Aug 21, 20:09   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I have a suspicion that the process of updating to macOS Big Sur 11.5 & 11.5.1 may have caused the weird behaviour. So I’ve posted this note as a reminder, in case other users get oddball errors over the next few weeks.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums