14.7 C
New York
Sunday, April 19, 2026

music.app – Applescript to set EQ of a monitor


I do not know a lot about AppleScript, however over the previous few days, three totally different LLMs have claimed they perceive it, after which proved to me that they know much less about it than I do.

This is a script that works as is (variant of the one within the cited Q/A):

on run argv
  set m3u8_path to merchandise 1 of argv
  set pname to merchandise 2 of argv
  set fileRef to open for entry POSIX file m3u8_path
  set trackList to learn fileRef as «class utf8» ¬
                   utilizing delimiter (ASCII character 13)
  shut entry fileRef
  inform utility "Music"
    make new playlist with properties {identify: pname}
    set pl to first playlist whose identify is pname
    set targetPreset to first EQ preset ¬
                        whose identify is "Spoken Phrase"
    repeat with fpathStr in trackList
      set falias to POSIX file (fpathStr as string) as alias
      add falias to pl
      -- set present EQ preset of ??? to targetPreset
    finish repeat
  finish inform
finish run

GPT and Mistral every spent no less than an hour giving me “do this” again and again with run-time errors or syntax errors each time on some try on the commented out activity.  falias at that time is or factors to the monitor simply added to the playlist.  However earlier than I can change its EQ from “None” to “Spoken Phrase,” they inform me I’ve to acquire a special sort of reference to that monitor, however then (if it is even true), they reveal that they don’t have any clue how to try this whereas pretending to grasp it.  (Forgive me if I for simplicity use phrases as if they’re human.)

I seemed for an instance on the net of somebody who had accomplished it, however no success.

On the commented level,

  • fpathStr is absolutely the path within the filesystem of the MP3 file, the place Music.app has copied the file.
  • falias is the monitor or factors to the monitor in some way
  • falias or fpathStr or “final monitor in playlist” have to be used to create or discover one thing to exchange “???”

Related Articles

Latest Articles