Yep! You keep the file in your project. As the AppleScript file is essentially treated as a NSObject class you can keep it wherever you keep your other Swift files. Or as I like to do it, make a folder called scripts and keep it there.
Hey Ayesha, I believe you can use the Dispatch Framework – specifically `DispatchQueue.async(() ->)` to execute your code asynchronously. But, if you’re looking for async functions, such as to return a value asynchronously, I don’t believe that’s possible.
Thank you Halid!
I was researching about this very same topic and I’ve found that we can use distributed notifications to listen to events like when the track has changed, etc…
Here are some good references:
That’s not covered in this post. You can use a service like musixmatch, or if even get the lyrics from iTunes you’re a subscriber to Apple Music. That should be easy once you get the artist and song name.