You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Xcode / AppleScript / AppDelegate.applescript file

I am having a lot of issues following this video tutorial. I'm getting hung up on the AppDelegate.applescript file. AppleScript Facelift


Here are the steps I'm taking:

1. Create a new project

2. Then I choose "App"

3.1 Options for interface

3.2 Options for Language

4.Save to file location

5. "Template" files created

6. I can add frameworks and libraries (not sure if this is necessary? im doing things blindly...)

7. Then these are the AppDelegate files. (note- I can change the identity and type in the top right fields. if I select AppleScript Uncompiled Source, it does not change the extension)


I've tried creating a new "blank file" and saving it as AppDelegate.applescript, but I don't think this is working. Can someone point me in the right direction???


I've been working on an AppleScript project which works with my Apple Music. Someone mentioned I should look into Objective-C AppleScript, but this is making no sense. I think my end goal is having a window that allows more flexibility with input...



Thanks in advance!

MacBook Pro

Posted on Oct 22, 2022 1:14 PM

Reply

Similar questions

3 replies

Oct 22, 2022 5:15 PM in response to Timbot13

Maybe somebody else here can help out more. This is headed in a direction I don’t usually traverse.


I’d tend to go with Swift here, as Apple is focusing more on that than on AppleScript. Swift also runs across macOS and devices.


What will probably be the APIs you’ll be using:

MusicKit - Apple Developer

https://developers.apple.com/videos/play/wwdc2021/10294/


Here’s a semi-recent discussion of AppleScript with the Music app, if you want to continue the AppleScript path:

https://apple.stackexchange.com/questions/406941/applescript-and-music


The AppleScript support and ScriptingBridge support and related tends not to be front-and-center in Apple, AFAICT.


Usual tool for AppleScript—.you’re almost certainly familiar—is Automator. The Swift (rough) equivalent is Swift Playgrounds, which allows previewing the UI, and easier debugging.


PS: One third-party option that might interest is the AppleScript debugger available from: https://latenightsw.com/

(I don’t use this tool, but know folks that do.)

Oct 22, 2022 4:15 PM in response to MrHoffman

So I created a bunch of script libraries which I’d like to use. I forgot the context, but someone mentioned using objc-AppleScripts. Based on what I found digging around, I think being able to have the GUI Xcode offers will be very helpful.


main goals of AppleScripts:

  1. ”tagging” songs (aka adding to playlists). If this worked in shortcuts, this whole project would never be a thing… it doesn’t sync across devices when I run the shortcut (unless it’s on my Mac) the other issue which I created a workaround for is the “duplicate” command in AS doesn’t work if it’s a url track. So that’s pretty important to use.
  2. another function is my “mix maker” which populates playlists based on criteria. Then a plethora of smart playlists creates one “mix” which is then copied over as a static playlist.
  3. this is gonna be a future endeavor- but I’d like to also export the XML file Apple Music spits out when you export the library into an SQL database. I think this is where someone mentioned I should check into objc-AS.
  4. I also have some ideas for photos app and mass tagging which some of my script libraries I created will work with.


Thanks for your quick reply!

Oct 22, 2022 3:30 PM in response to Timbot13

That video is from 2013, and a whole lot has changed since then. Xcode is very different.


Which macOS and which Xcode version?


What are you attempting to script here? Any particular app? Apple Music?


Swift and ObjC among other languages have (optional) access to a user’s music library, if you’re working toward a different player app. Shortcuts might be another option.

Xcode / AppleScript / AppDelegate.applescript file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.