Error -10,000 "method newAlbumID expected 0 arguments, got 5"

This one is for the developers. I’m not sure whether its an AS or SD error. However, if I did something wrong, I’d like to learn.

After cutting out out a bunch of lines in my script (now 1,500 with lots of comments), I started to get this Apple Script execution error with SD as the identified application. My script runs fine the first time after each compile. From the second time, it returns the error in the topic at the point the method is called. The script runs fine in AS Editor. I have no local or global variable named newAlbumID. The behavior is the same whether preceded by “my” or not. Adding or deleting arguments did not change the error behavior.

I have the following loaded:
use AppleScript version “2.4”
use framework “Foundation”
use scripting additions

The arguments are straightforward properties, local variables, and record properties.

I am not using “Foundation” elements in these scripts, to my knowledge. When I comment out “use framework “Foundation””, I get this Apple Script execution error on every run after compilation: «script» doesn’t understand the “newAlbumID” message.

I appear to have suppressed both execution errors by renaming the method newAlbumID2, at least for now.

You appear to have forgotten to attach the script (or a link to it) to your post.

Well, You asked for it. :slight_smile:

The main file is MakeTags. You need to select a track in iTunes, preferably a classical track with name in form “work; movement”

BTW, I’m running High Sierra latest version, SD 2.8.1 (183.1), AS 2.5

argumentErr.zip (399.5 KB

The script you posted has a handler called newAlbumID, as well as using the same name for locals in a couple of places. That’s really not a good idea.

Shane. Thanks for addressing. My script evolved a bit between the time of the original post and posting the script with a simple rename of the handler and quick check that the error was the same.

Prior to the original post, I did search for the variable name. However, as I recall, I had a record item named the same. I thought that was buried enough to not cause problems—maybe not.

I apologize for not posting the script with the first post.