Set trackName to (text (x + 6) thru -1 of thisItem)Įlse if thisItem starts with "Artist:" then Set x to the offset of "Title:" in thisItem Repeat with i from 1 to number of items in paragraphList Set the paragraphList to every paragraph of thisText Set sourcePath to open for access file "Library:MegaSeg User Data:Logs:Logs for MegaSeg System (4):NowPlaying"Ĭlose access file "Library:MegaSeg User Data:Logs:Logs for MegaSeg System (4):NowPlaying" I am presumably locking the file to read from it and stopping MegaSeg writing to it. More importantly, as soon as I run this, MegaSeg stops updating the file, forever. However when I try running it from LadioCast I get an EOF -39 error. The script below nearly works when run from the Applescript Editor it does seem to get the Title, Artist and Album into the variables. However the text in the file seems to be already trimmed. First, the file is in a specific location and not on the desktop second, I could not get 'trim_line' to work at all - I got "script does not understand trim_line message". I tried the suggestions from and they were very helpful, but not all of them worked. ![]() Set metadata song to trackName & " – " & trackArtist & " – " & trackAlbum If trackName is not lastName and trackArtist is not lastArtist and trackAlbum is not lastAlbum then ** in the following, "title", "artist" and "album" are from the text file ** ** insert missing file reading section here If we imagine that I was able to grab that info, this is what I would do with it: set lastName to "" ![]() set trackName to name of current track' so I can't do it that way. MegaSeg doesn't support Applescript calls like 'tell application "MegaSeg". I want to pass this to my broadcast streamer LadioCast, which can be addressed via AppleScript, so that it sends info on what is playing to the streaming server. While running, my broadcast playout system (MegaSeg) writes details of the track currently playing to a textfile called "NowPlaying" which contains solely the following contents, each on its own line and without square brackets: Title: I know virtually nothing about AppleScript and could do with some help.
0 Comments
Leave a Reply. |