Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
Okay, so I have written an applescript that basically launches opera in kiosk mode and then enters a keystroke command. This works fine on its own and if I drag it into my login items, it even launches at login as I would expect.

Now the trouble:

I am working on an installer and this applescript needs to automatically be added to the users startup items at some point during the package install. I have been able to get it copied to /Library/StartupItems (with correct permissions even), but it will not launch at login as I would expect. What am I missing?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
You should just add it to a folder such as ~/Library/Application Support/etc if you only need it for the current user.

The login items list can be modified various ways, but assuming you only know AppleScript you can still use AS to modify it:
http://macstuff.beachdogs.org/blog/?p=30
 

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
That looks like it will do nicely, now how can I run it during a PackageMaker install? I tried adding a similar post-install applescript, but couldn't get it working.

Thanks so much for your input
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Probably can use osascript to run the script in your postflight script. Search Apple's documentation for info on how to use this.
 

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
Okay, I have my postflight script written and it works perfectly when I run it after the package install, but only runs half of the commands properly when it runs as part of the installation. How do I make the script run after EVERYTHING else has been completed in the package installation (including component registration)?
 

nomar383

macrumors 65816
Original poster
Jan 29, 2008
1,310
0
Rexburg, ID
In case anyone later runs across this thread, I ended up making a post install applescript to include in my DMG. I instruct the user after my installation to just double click on the included applescript. Worked for me.

And the login item instructions posted earlier worked perfectly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.