Is there an alternate script location for Macs?

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
bergdesign
Junior Member
Posts: 13
Joined: Sat May 25, 2019 4:23 pm

Is there an alternate script location for Macs?

Post by bergdesign » Thu Mar 11, 2021 6:54 pm

Is there an alternate location, other than inside the application bundle on Macs, to install scripts so that they are auto-loaded when the app is launched? On the Mac, the only "documented" location that I have found is inside the application's bundle under /Contents/Resources/scripts, but this location now appears to be off-limits due to Apple's tightened security measures in Catalina and later. I have searched and cannot seem to find documentation that describes an alternate script location, although I seem to distinctly remember a post talking about the Application Support folder being an alternate location. However, there is no existing folder structure within the app support folder that suggests where to place scripts.

So in my experience, Catalina 10.15.7 seems to no longer be tolerant of modifications to the app bundle and the system will report that the app is damaged when launched if scripts have been copied into the bundle. Further, removing the script(s) doesn't seem to fix the warning, so you have to delete the app and re-install it again from a download. Just a heads-up that one of the recent security updates has tightened restrictions on app bundle modifications on the Mac.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Is there an alternate script location for Macs?

Post by andrew » Thu Mar 11, 2021 7:35 pm

You can place local scripts into

/Users/[username]/Library/Application Support/QCAD/QCAD

Where username is your login name or home folder.

For example:

/Users/andrew/Library/Application Support/QCAD/QCAD/scripts/MyScript/MyScript.js

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”