Permission asked every time

Discussion in 'Mac Programming' started by nelly22, Oct 7, 2018.

  1. nelly22 macrumors 6502

    Joined:
    Sep 29, 2009
    #1
    Why i get this dialog every time i launch my AppleScript app? Should it happen only once?

     
  2. Red Menace macrumors 6502

    Red Menace

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    AppleScript application properties and global variables are saved within a script file, so each time the application is run it gets modified, which makes it a different application as far as the system is concerned. The application should be code-signed, embedded script files can be made read-only, or the script application can be created in Xcode to prevent it from being modified when run (note that properties will not persist, so different methods will need to be used to save items between runs).
     
  3. nelly22 thread starter macrumors 6502

    Joined:
    Sep 29, 2009
    #3
    So there is two ways to do it, code-sign app, embedded script files made read only or create script app in Xcode.

    I'm newbie. Is there any guide how to do these things?

    I installed Xcode and it has tons of confusing stuff like General, Capabilities, Resource Tags, Info, Build Settings, Build Phases, Build Rules, etc.
     
  4. Red Menace macrumors 6502

    Red Menace

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #4
    Well, Xcode is a beast no matter how you look at it, so it depends on how serious you are wanting to get. The easiest way, especially if you are just using it yourself, would be to just go to the script inside the application bundle and use the Get Info panel to change its permissions to read-only.

    If you are wanting to use Xcode, go to Preferences > Accounts, log in with your Apple ID, select your Team (Personal Team), then add a new certificate with Manage Certificates. After making a certificate, you can set the Signing Certificate (for whatever build) in the General tab to Mac Developer. Beware if you are using Xcode 10 in Mojave, as there are a lot of extra entitlements and permissions gotchas.

    If you have Xcode installed, there is also the codesign shell utility, which you can use with a self-signed certificate you create with the Keychain Access utility.

    Piece of cake (?!)
     

Share This Page

3 October 7, 2018