Re: Help please
Re: Help please
- Subject: Re: Help please
- From: John Delacour <email@hidden>
- Date: Fri, 15 Nov 2002 09:22:56 +0000
- Mac-eudora-version: 5.3a9
At 1:40 pm -0600 14/11/02, Amir Bozorgzadeh wrote:
How can I attach this so that
it runs after Word is closed? Is there a way to do this? Or having it
run when Word is launched is even better.
tell application "Finder"
try
delete file "Office Registration Cache X" in folder
"Microsoft" of folder "Preferences" of folder "Library" of folder
(path to current user folder)
empty trash
end try
end tell
Essentially my thought was is there a way I can attach it to the
application Word so that every time it launches it runs this script.
path to preferences will shorten the script:
set f to""&(path to preferences)&"Microsoft:Office Registration Cache X"
try -- remove the file if it exists
do shell script "rm " & quoted form of POSIX path of f
end try
tell app "Microsoft Word" to activate
having it run when Word is launched is even better
Do you mean, as I guess you do, that you want the file deleted before
Microsoft looks for the file on launching? This would be more
difficult. You could write a stay-open applet to launch hidden at
login and to delete the file periodically, or you could do something
more secure with cron in the shell, which I can't advise on.
on idle
set dir to do shell script "echo $HOME"
set f to dir & "/Library/Preferences/Microsoft Office Registration Cache X"
try
do shell script "rm " & quoted form of f
end try
return 30 -- run every 30 seconds
end idle
-- JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >Help please (From: Amir Bozorgzadeh <email@hidden>) |