Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relaunching application...



Is there a reserved word or routine to relaunch the application?

I suppose perhaps it would be something like

	tell app "whatever" to activate
or
	tell me to activate

but if you have that after you've quit, I don't think it will be called. I suppose you could try putting those lines in the "on quit" handler, but, even if that worked (unlikely), you then could never quit ... !

Fundamentally I think you are going about it the wrong way.

Why do you want to relaunch your app? If the answer is "because I want to load the log file I created on first launch", then I think you need to re-think the sequence of what you are doing.

It may well be that I have misunderstood your question. But I am wondering whether you have misunderstood my answer. My answer was nothing about creating the files. If you do things in the sequence I suggested, there is no need for a relaunch in order to load the log file. That's the fundamental point.

There is just code in the "on launched" handler that runs in two ways depending on whether the files exist:
on first launch the files don't exist, so they are created, and then the log file (just created) is loaded
on subsequent launches (after the user has quit) the files exist, so there is no need to create them, and the log file is loaded.
Either way the log file is loaded, so there is no need to relaunch ...


... or am i still misunderstanding?

Philip


On 28 Jul 2005, at 15:24, Bernardo Hoehl wrote:

Hi Philip,

Thanks for posting.

In fact I already have the routines for creating folders.

My dificulty is in reLaunching the app.

For example:

If I add a line like:

tell me to quit

The application will quit, but will require the user to double click the application icon again to relaunch the app.

Is there a reserved word or routine to relaunch the application?

Bernardo


=================


On 28 Jul, 2005, at 10:17 AM, Philip Buckley wrote:

Immediate thought is simply to test for the existence of the folders and files on launch and create them only if they are not already there (which will only be on on the first launch), and then load the log file.

So it would go something like (with hypothetical subroutines):

on launch
	if not existFilesFolders() then
		createFilesFolders()
	end if
	loadLogFile()
end launch

First launch - do the files exist? > no > create them > load log file
Subsequent launches - do the files exist? > yes > (do nothing)> load log file


Philip


On 28 Jul 2005, at 13:42, Bernardo Hoehl wrote:

Hi List!


I have this little application that on the first launch creates a few folders and files inside the user's application support folder.


Well, the fact is that I once run for the first time, I have to close and open the application again, so that it loads a log file that I have just created.

Can anyone give me a clue of how I could do this?

I imagine I could use another app to do this. But I think there could be another simpler way of doing it.

Thanks,

Bernardo Hoehl
Rio de Janeiro - Brazil



_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Relaunching application... (From: Bernardo Hoehl <email@hidden>)
 >Re: Relaunching application... (From: Philip Buckley <email@hidden>)
 >Re: Relaunching application... (From: Bernardo Hoehl <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.