Running Applescript in Background

Hi,

I’m working on an applescript that helps me put a list of songs from iTunes on my website.
http://gummibearheads.com/itunes ← there it is. (i’ll put a paragraph below on how it works)

I have the script working really well, I think. My only beef is that every time it runs, the dock icon pops up and the system’s focus moves to it (ie: you you lose what you just typed/clicked on).

I dont mind the icon so much (it’s kinda nice to see that its running) but I can’t stand the losing the focus thing.

So google didn help me much. I saw a lot of people asking the questions, but only 1 place with an answer.

http://www.macosxhints.com/article.php?story=20050517210406483

according to that article, i put this in after the first line in my info.plist file and it should work.

<key>NSUIElement</key> <string>1</string>
It does work, but for some reason its now asking me if I want to run that script?

http://gummibearheads.com/images/dialog.jpg ← there is a screenshot (Pics dont seem to work for me)

If I click run, it does start up, run and quite in the background.

Anyone know how to get rid of that dialog?

http://bbs.applescript.net/viewtopic.php?id=14664

thanks for the link, but that did not work for me.

when I uncheck that box, it still shows a dock icon and takes the focus away from whatever i’m doing.

and when I add that info to the preference file the dialog box pops back up again.

Hmm… Start over…

Resave your script… Make sure it’s set to Format “Appllication Bundle” with options “Run Only”, (and “stay open” if you want it to stay open). Do not check “Startup Screen”.

Then go to the location of the file you just saved, and go into the package contents, and contents folder, and modify the Info.plist.

Go all the way down and findl the LAST in the file… before that line, add:

LSUIElement
1

Then launch your terminal and enter:

cd /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support

then type:

./lsresgister -f Path/To/Your/Applet/NameOfApplet.app

that works for me…