Issue with application running on log in

fbaker
New Contributor III

Hello everybody, I'm running into an issue every now and then, and I'm not sure how to fix it or how it breaks.

I've wrote a script to map network drives according to AD group memberships and saved it as an application. I then created a configuration payload for Login Items and pointed it to the app.

When logging in, the app pops up in the dock for a short second, and then quits. Manually trying to launch the app does the same thing. Opening the package contents and trying to run the script does nothing either.

Is there a way to check why this is happening, or is there a better way to have network volumes mounted based off of AD memberships and groups?

3 REPLIES 3

joshuasee
Contributor III

Try starting the script application from the command line in terminal without using open or other handlers and see what it reports, if anything, as it attempts to run.

/path/to/your/Script_App.app/Contents/MacOS/applet

fbaker
New Contributor III

@joshuasee Tried what you said, and it does the same thing as if I went and just clicked on it from my Applications folder. It pops open briefly in the dock and closes right away.

Manually going into the package contents and running the applet I got the following.

Last login: Fri Dec 9 08:38:29 on ttys000
/Applications/LoginScript.app/Contents/MacOS/applet ; exit;
TH_TECH_MBP01:~ fbaker$ /Applications/LoginScript.app/Contents/MacOS/applet ; exit;
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...none found.

[Process completed]

bentoms
Release Candidate Programs Tester

@fbaker Sounds like an issue with the AppleScript...

I'm guessing this might have been based on something I blogged a few years ago? I might be able to help, but we'd need to see the AppleScript...

Are you on the macadmins.org slack? If not, join up.. there's an AppleScript channel there. Mention me (macmule), & if about I can have a look.