• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: running script app at logout, Panther
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: running script app at logout, Panther


  • Subject: Re: running script app at logout, Panther
  • From: Donald Hall <email@hidden>
  • Date: Tue, 27 Feb 2007 17:13:55 -0700

Axel,

Thanks for taking the time for your lengthy reply.

I eventually got it to work by eliminating the 'open' statement, so your conjecture about when logout hooks are called being different in Panther may be correct.

I put the full path to the applet inside the application bundle into a variable called myapp in my shell script, and put the following line into the script:

	"$myapp"

This successfully fired up the script application in Panther. The original line:

	open "$myappbundle"

where myappbundle contained the path to the bundle of the script application did not work in Panther (at logout time), but did in Tiger. I could have sworn I had tried the first way earlier without success in Tiger, but I must have been doing something else wrong.

To answer your question about installing the logout hook, I used "sudo defaults write...." etc. This puts the LogoutHook property into the correct plist file in /var/root/Library/Preferences. (root is the owner of the processes run at logout.)

I don't think osacript will work properly at logout time - at least, I couldn't get it to, and correspondence with another user confirmed he ran into the same problems and ended up using an application.

By the way, when the script application runs, every visible application is already gone - there is no menu bar or Dock, and then the menu bar reappears for the script application. You can also put up dialog boxes - obviously not the best idea at logout.

Thanks again,

Don

At 12:00 PM -0800 2007/02/27, Axel Luttgens wrote:
From: Axel Luttgens <>
Subject:r
To: AppleScript Users <>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 27/02/07 5:56, Donald Hall wrote:

 Does anyone have any experience running an AppleScript application at
 logout in Panther? I have it all working fine in Tiger, but not in
 Panther.

 I have installed a logout hook shell script that starts up  an
 AppleScript script application. Running the logout hook script from
 Terminal in Panther works perfectly - the script application fires up
 and does what it is supposed to.


But what exactly is it supposed to do?
For example, does it involve some user interaction, or target other apps...?

 It is only at logout that it doesn't work. I know the logout hook
 shell script starts at logout because it creates a file and that file
 shows up where expected. However, the script application does not start.


Does it not start, or is it unable to complete its tasks?
The nuance may be enlightening... ;-)
Do the various logs show something?

 (I use the 'open' shell command to start the script application
 because it is a bundled application and otherwise it didn't seem to
 work at all.  A bundled application is the only way to get a universal
 binary.)


The open command require a lot of things to be running or available
(such as LaunchServices).
Perhaps could you try with osascript?
And, if your AS app isn't too huge/sophisticated, perhaps could you even
write it as an inline AS script and feed it to osascript from within
your shell script?

 Does anyone have any suggestions? As I said, it works fine in Tiger. I
 can logout and my script application behaves exactly as expected.


I'm not sure, but I am under the impression that Tiger calls logout
hooks earlier in the logout process, when more OS pieces are still
available, than Panther.

BTW, how do you install the hook under Panther? As a loginwindow's
logout hook, or directly in /etc/ttys?

 Is there another way to start a script application in Panther other
 than with 'open'? I tried to execute the 'applet' inside the bundle
> directly, but couldn't get it to work.

Thanks,

Don


Hmmm, really just guessing here...
But, if you don't mind to share your app, I could do some trials here
while benefitting from a better understanding.
Axel

-- Donald S. Hall, Ph.D. Apps & More Software Design, Inc. email@hidden http://www.appsandmore.com _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Prev by Date: Re: running script app at logout, Panther
  • Next by Date: No dictionaries loading for applescript in script edito library or xcode library
  • Previous by thread: Re: running script app at logout, Panther
  • Next by thread: What's new in Leopard?
  • Index(es):
    • Date
    • Thread