Re: How do I move my running app?
Re: How do I move my running app?
- Subject: Re: How do I move my running app?
- From: Satoshi Matsumoto <email@hidden>
- Date: Tue, 04 Jul 2006 09:33:18 +0900
- Thread-topic: How do I move my running app?
Hi, Alan
on 06.7.4 8:24 AM, Alan Smith at email@hidden wrote:
> On queue, I want to move my app into a folder that would have just
> been created. I've found that this can't be done if the app is
> running.
> I need to find a way to run a command so it sleeps for a few seconds
> while my app quits, then move the app and restart it.
This is not a Cocoa app but an AppleSript "Restart Finder" that quit Finder
and wait while Finder is quitting, then launch Finder again.
---------------------------
tell application "Finder" to quit
set theTime to time of (current date)
set maxTime to theTime + 3
repeat while theTime < maxTime
if time of (current date) > theTime then
if IsProcessExist("Finder") is false then
tell application "Finder" to launch
return
end if
set theTime to time of (current date)
end if
end repeat
display dialog "Failed to quit Finder!" buttons {"OK"}
return
on IsProcessExist(inAppName)
tell application "System Events"
copy every process to theList
set outResult to false
repeat with theItem in theList
try
if name of theItem is inAppName then
set outResult to true
return outResult
end if
on error
set outResult to false
return outResult
end try
end repeat
end tell
return outResult
end IsProcessExist
---------------------------
Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden