Thank you all who had interest in my problem.
I didn't solved it now actually, but I found a solution to it, so to speak.
First, there was a problem in the environment, I guess. When I tried "sudo -u $USER osascript..... ", it prompted a "password:", although the user is already logged in and issued the shell script.
Second, when the script is invoked, it displayed a prompt like "sh-3.xx:", instead of usual prompt.
But when I came back home and tried same thing on my MacBook, it didn't ask a password and it displayed normal prompt after invoking the script. So, somehow the Mac system I use at my company was somehow changed by someone. ( In my case, I know Unix and Mac. So, I don't do anything which can break system.. )
So, with my own home machine, it could invoke shell script and a AppleScript file which the shell script invokes.
Now, I tried adding login item. When I made a package for the Leopard, it could add the login item successfully. The script I used is :
tell application "System Events" make new login item at end with properties {path:"blah blah.app", hidden:false} end tell
However, when the package is made for the Tiger, it failed in registering the login item on the Leopard. It also mentions, "The sample was built using Xcode 2.1 on Mac OS X 10." and the sample code was revisioned at 20, Sep, 2005. So, I think Apple tested the AppleScript on the 10.4 also.
Is there some error in the AppleScript?
Thanks
|