|
|
Remove Microsoft Word backups via AppleScript
How timely! I've just been grappling with recursive procedures to handle tedious tasks. For the record, Rob, if you use MS Word, you should definitely enable "Always create backup copy." Word & Excel crash on me regularly, that backup has saved me many a time.
Robert, in regard to the comment in your script asking why global variables need to be passed to functions, the answer is they don't. You didn't make them global. To do so use either the "global" or "property" declarations; the latter is more convenient. Below is a quickie script illustrating them. From reading the Applescript Language Guide (pp. 311-323), it becomes obvious that scope of variables is a tricky business in AS. Something that was not at all obvious, however, and which AFAICT is not stated out loud anywhere in the Guide, is that parameters to subroutines ("run handlers") do not reveal any modifications upon return from the routine, that is, they are always local to the subroutine. Apparently, if you want more than a single value returned from a handler, you'll have to do it in a list or other structure. Took me a while to overcome my disbelief... passing parameters by reference is such a fundamental core value, I never questioned that it wouldn't be so! Anyway, thanks for your script - check out these tidbits...
Remove Microsoft Word backups via AppleScript
Thanks for the advice on globals...and glad to be of help on the recursive function. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|