• 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: Help please
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Re: Help please
  • Next by Date: Web page download
  • Previous by thread: Re: Help please
  • Next by thread: Re: A Tragedy of Errors was Re: handler failure
  • Index(es):
    • Date
    • Thread