1

Does anyone knows how to use the javascript functions of the Photo Suite in Apple's OSX script editor? The documentation is really bad or I do not understand the way of using it.

Doc description:

make method : Create a new object. Only new albums and folders can be created.
make
new: type : The class of the new object, allowed values are album or folder
[named: text ] : The name of the new object.
[at: Folder ] : The parent folder for the new object.
Album or Folder : The new object.

My code:

nameOfAlbumForPhotosWithoutAlbum="PhotosWithoutAlbum"

I tried the following, however none worked:

albumForPhotosWithoutAlbum=photos.make(album,nameOfAlbumForPhotosWithoutAlbum)
albumForPhotosWithoutAlbum=photos.make(photos.album,nameOfAlbumForPhotosWithoutAlbum)
albumForPhotosWithoutAlbum=photos.make(photos.album.type,nameOfAlbumForPhotosWithoutAlbum)

After reading the manual again, I tried the following, again without success. It returns: Can't find variable: Album. The same happens to lower case. I tried typeof, but I do not know how to get the type of the class Album.

albumForPhotosWithoutAlbum=photos.make({new:Album.name,named:"TestFolder"})

Thanks!

mhl5k
  • 61
  • 1
  • 4
  • 1
    JavaScript for Automation is half-baked and buggy, and documentation and community are virtually non-existent. Apple abandoned it pretty much as soon as it went out the door. I suggest you stick to AppleScript—the language is lousy, but at least the automation stuff works right and you can always find other users to help. – foo Apr 17 '20 at 20:42
  • 1
    I totally agree, so actually stackoverflow is my last idea to find out how it may work. The documentation is really terrible and I decided to not learn Applescript at all, for a onetime shot script I need. But at all, you are right. – mhl5k Apr 18 '20 at 07:07

0 Answers0