Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Classic Macs and Mac OS > Shutdown folder

Shutdown folder
Thread Tools
vwa
Fresh-Faced Recruit
Join Date: Dec 1999
Location: Heidelberg, Germany
Status: Offline
Reply With Quote
Dec 10, 1999, 10:01 AM
 
Hi,

I have the following problem:

for reasons of logging my daily activity I would like to bring up a special dokument whenever I start the computer and also when I shut it down.
So the natural solution would be to place a alias of this ducument into the startup and also into the shutdown folder (I use a german system and maybe the terms are a little different, but you know what I mean..).
For startup everything works fine! On shutdown I have no chance to work on my document, because after opening it closes it immediately again and the machine continues the shutdown procedure!?
Did I misunderstand something or how can I do it?

------------------
     
Mac Elite
Join Date: Nov 1999
Location: Milwaukee
Status: Offline
Reply With Quote
Dec 10, 1999, 02:21 PM
 
I've seen utility programs that run after selecting shutdown, but I've never seen a file open in that situation. Once you select shutdown, it's going to shut down. I don't think you'll be able to view a file then. The utility programs I've seen do not abort the shut down either. They run, then it shuts down, and you can't stop it.
Ya gotta applaud those bunnies for sacrificing their hearing just so some guy in Yonkers can have better TV reception.
     
Junior Member
Join Date: Dec 1999
Location: Boston, MA, USA
Status: Offline
Reply With Quote
Dec 16, 1999, 11:06 AM
 
I'm not that great at it but i'm sure that you can find or create an applescript that would allow you, once clicking, to open the document, make your changes, and then upon quitting shut down the computer. Anyone?
     
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Jan 10, 2000, 03:22 AM
 
Hi all,

Hope you've already found a better solution elsewhere... If not, here's an AppleScript script that may work for you. Basically, it asks the appropriate application to open the desired document, then loops waiting for the application to quit, before exiting and allowing the shutdown to proceed (hopefully).

After replacing the "..." strings at the top of the script with your specific application name (e.g., "SimpleText") and document pathname (e,g,, "Macintosh HDersonal:My Notes"), try saving this script as an applet (application) in the Shutdown Items folder.

-- ================================================== =======================================
try
set theAppName to "..."
set theDocumentPathname to "..."

-- Ask the app to open the document
tell application theAppName
activate
open (file theDocumentPathname)
end tell

-- Wait for the app to quit
set isAppStillOpen to true
repeat while (isAppStillOpen)
-- Yield to give time to the app, and to other apps
delay 1

-- Determine whether the app is still open
set isAppStillOpen to IsApplicationOpen(theAppName)
end repeat

on error errMsg number errNum
display dialog ("Error: (" & errNum & ") " & errMsg) buttons {"Stop"} default button 1 with icon stop

end try

-- ----------------------------------------------------------------------------------------------------------
on IsApplicationOpen(thisAppName)
set isAppOpen to false -- Initial assumption

-- Ask the Finder if the application is still running
tell application "Finder"
set theMatchingApps to (get application processes whose name is (thisAppName as string))
if ((count theMatchingApps) > 0) then
set isAppOpen to true
end if
end tell

return isAppOpen
end IsApplicationOpen
-- ================================================== =======================================

Good luck.
     
alpha
Guest
Status:
Reply With Quote
Jan 17, 2000, 08:28 AM
 
A method is to have the application that opens the document to ignore all Process manager quit and shut down commands. The system will have to wait until the application is manually quit.
Most modern and well-behaved Apps will never ignore quit commands from the Process Manager, so a custom one will have to be created.
Fiddling with the App's 'SIZE' resource to ignore high level events could work.
     
vwa  (op)
Fresh-Faced Recruit
Join Date: Dec 1999
Location: Heidelberg, Germany
Status: Offline
Reply With Quote
Jan 19, 2000, 05:00 AM
 
Thank you all and especially Paul Crawford for his Apple Script which solved my problem.

I just hacked it in and it worked, but (honestly) I do not know exactly why! I think I have to learn Apple Script in more detail!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 09:00 PM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2