1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automating/Scripting on MacOS

Discussion in 'Apple Software' started by GR63, 20 Oct 2021.

  1. GR63

    Wise Guy

    Joined: 28 May 2021

    Posts: 1,017

    Location: Herts

    I wonder if MacOS does this in a similar fashion to Windows..

    What I would like to do is apply a script to file by drag/drop

    eg for ApplicationX.app

    sudo xattr -lr /Applications/ApplicationX.app
    sudo xattr -cr /Applications/ApplicationX.app
    sudo codesign -f -s - /Applications/ApplicationX.app

    So I want a script that I can drag the ApplicationX onto and release and have it do those 3 things?

    Anyone help a MacOS noob out, please?
     
  2. VaderDSL

    Capodecina

    Joined: 18 Oct 2002

    Posts: 15,766

    Location: Manchester

  3. MagicBoy

    Capodecina

    Joined: 18 Oct 2002

    Posts: 18,504

    Location: South Manchester

    Yeah, worth checking Automator, although it more a drag and drop tool for those who don't need to know the command line exists. It's been around since the earliest versions of OS X.
     
  4. GR63

    Wise Guy

    Joined: 28 May 2021

    Posts: 1,017

    Location: Herts

    It does... I'm so noob to macOS I was hoping for more spoonfeed!
     
  5. MacRS4

    Mobster

    Joined: 15 Dec 2008

    Posts: 2,523

    Location: London

    I gave up on MacOS native scripting and just use PowerShell now. Lazy I guess.
     
  6. GR63

    Wise Guy

    Joined: 28 May 2021

    Posts: 1,017

    Location: Herts

    Does powershell work on Mac?
     
  7. MacRS4

    Mobster

    Joined: 15 Dec 2008

    Posts: 2,523

    Location: London