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: 15
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: 8774
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

bergdesign
Junior Member
Posts: 15
Joined: Sat May 25, 2019 4:23 pm

Re: Is there an alternate script location for Macs?

Post by bergdesign » Sat Feb 15, 2025 4:15 pm

Hi Andrew.

Since updating to 3.32.1, I noticed that my interactive scripts weren't loading at launch from the alternative script location... I found your changelog mention of "add support for RCC plugins," so I downloaded the Qt tools and built my scripts as an RCC plugin, added a "plugins" folder next to the existing "scripts" folder, dropped my packed scripts in that folder and all works fine again.

My question is, did your drop support of unpacked scripts in the alternative script location? If so, you might add this detail to your docs somewhere so devs use the new RCC method. Also, you might add the RCC tutorial page to your Documentation > Tutorials page since I could only get to it from the changelog page.

Thanks,
Brock

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

Re: Is there an alternate script location for Macs?

Post by andrew » Mon Feb 17, 2025 2:11 pm

Please double-check the data location as this might have changed:

Code: Select all

RSettings.getDataLocation()
Local resources must be placed under this data location, for example

Code: Select all

RSettings.getDataLocation() + "/scripts/MyScript/MyScript.js"

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”