Xcode 10 and .applescript files

(Phil Stokes) #1

Has anyone else noticed/been affected by this?

I have a couple of .applescript files in my project. I call them using Bundle.main.url(forResource: scriptname, extension: "applescript")

My build settings are set to copy these scripts but not compile them.

Xcode 10 compiles them anyway (this did not happen in Xcode 9 or earlier), so that they appear in my Resources folder as “.scpt”, which of course fails the extension match.

My solution was simply to rename these files without a file extension and pass nil to the extension parameter.

But I don’t understand why this change in behaviour has occurred; I didn’t see it in the release notes or the headers.

(Mark Alldritt) #2

Perhaps Xcode 10 introduced a new Build Phase rule for .applescript files that is now getting invoked without your asking for it. May have to go through the target Build Phases and remove it.

(Shane Stanley) #3

It sounds bug-worthy to me. I hit a problem in one of the betas where compiling of a .applescript file wouldn’t happen when it should have.

(Phil Stokes) #4

Not that I can see. When I said ‘my build settings are set to copy not compile’ what I actually meant/ should have said is that in Build Phases these scripts are excluded from Compile Sources and included in Copy Bundle Resources.

In Build Settings, I see there’s a section for OSACompile, but these are empty, so I really don’t know where this behaviour is coming from.

(Phil Stokes) #5

Yeah, maybe. That’s why I wanted to check whether anyone else had seen the same thing.

I’ll try to reproduce it in a sample project when I get a chance and file it if so.