Skip to main content
June 17, 2010
Answered

JS Library Sort Order Help

  • June 17, 2010
  • 1 reply
  • 363 views

Hi,

I'm using the code below to change (via script) the Sort Order of the Assets inside my Library. After the script finish I have no erro messages but nothing happens...the order on the Library Panel still the same. Any suggestion?

I'm testing with an empty document (1 page) and an open Library with some assets.

var myDocument = app.activeDocument;
var myLibrary = app.libraries.itemByName("LibraryName.indl");
var myLibraryPanel = myLibrary.associatedPanel;
myLibraryPanel.sortOrder.BY_TYPE;
myLibraryPanel.select(myLibrary.assets.item(0));

thanks

This topic has been closed for replies.
Correct answer Jongware

This line

myLibraryPanel.sortOrder.BY_TYPE;

does nothing. You probably meant

myLibraryPanel.sortOrder = SortAssets.BY_TYPE;

1 reply

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
June 17, 2010

This line

myLibraryPanel.sortOrder.BY_TYPE;

does nothing. You probably meant

myLibraryPanel.sortOrder = SortAssets.BY_TYPE;

June 17, 2010

Thanks Jongware,

Now it's working fine.