AppleScript to keep Office 2004 or X from opening files anddatabase on wrong drive?

  • Thread starter Norman R. Nager, Ph.D.
  • Start date
N

Norman R. Nager, Ph.D.

I've noticed that immediately after I've cloned volumes to the backup
internal hard drive with Retrospect's "Duplicate" feature, the first time I
click on a Word or Excel file alias, it leads to the wrong drive.

It seems that that the files on the backup drive at that point might be seen
by OS 10.3.x (and Office) as newer/more recent than what's on the primary
drive from which they've been cloned..

I was told that there "always" have been "minor issues" with Retrospect and
aliases. Unfortunately, I learned from experience that "minor" can turn
into major if one unknowingly works with an older file. I duplicate volumes
at least every 10 days and if I have been accidentally opening and writing
to any of the backup drive's files, they're wiped out by the cloning from
the primary drive.

A way to prevent that from happening is to unmount the volumes on the
secondary hard drive after cloning and before launching any component of
Office. This can be done by launching Disk Utility, click on each of the
two volumes of the backup drive and then on "unmount" and quit out of Disk
Utility.

But it's really easy to forget to do that after each startup or re-start and
it's also time consuming.

For me and anybody else who clones volumes from one internal hard drive to
another, might there be a login AppleScript that would do the following?

On startup, allow the four volumes on the two internal drives to mount
(which is required for other processes that check the backup drive). Then
unmount the two volumes on the backup drive. Please?

Respectfully, Norm
 
B

Bob Greenblatt

I've noticed that immediately after I've cloned volumes to the backup
internal hard drive with Retrospect's "Duplicate" feature, the first time I
click on a Word or Excel file alias, it leads to the wrong drive.

It seems that that the files on the backup drive at that point might be seen
by OS 10.3.x (and Office) as newer/more recent than what's on the primary
drive from which they've been cloned..

I was told that there "always" have been "minor issues" with Retrospect and
aliases. Unfortunately, I learned from experience that "minor" can turn
into major if one unknowingly works with an older file. I duplicate volumes
at least every 10 days and if I have been accidentally opening and writing
to any of the backup drive's files, they're wiped out by the cloning from
the primary drive.

A way to prevent that from happening is to unmount the volumes on the
secondary hard drive after cloning and before launching any component of
Office. This can be done by launching Disk Utility, click on each of the
two volumes of the backup drive and then on "unmount" and quit out of Disk
Utility.

But it's really easy to forget to do that after each startup or re-start and
it's also time consuming.

For me and anybody else who clones volumes from one internal hard drive to
another, might there be a login AppleScript that would do the following?

On startup, allow the four volumes on the two internal drives to mount
(which is required for other processes that check the backup drive). Then
unmount the two volumes on the backup drive. Please?

Respectfully, Norm
Why do you clone the drives? Why not just let retrospect make backups. You
can set up a script to make a full backup regularly (like weekly) and
incremental backups more often. Then set another retrospect script to copy
the backup set to another drive. This would be just as secure as yu current
method without the hassle.
 
P

Paul Berkowitz

Why do you clone the drives? Why not just let retrospect make backups. You
can set up a script to make a full backup regularly (like weekly) and
incremental backups more often. Then set another retrospect script to copy
the backup set to another drive. This would be just as secure as yu current
method without the hassle.

This is precisely what I do too. Full re-write backup every two weeks after
copying the current one to a second backup. I always have 2-4 weeks of daily
incremental backups. And I've only ever needed to retrieve anything twice!

--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Entourage you are using - **2004**, X
or 2001. It's often impossible to answer your questions otherwise.
 
N

Norman R. Nager, Ph.D.

The Retrospect backup sets (as opposed to the Duplicate clones) will not, as
far as I understand it, allow for a bootable replacement. During the course
of some of my beta testing, I've had drives so corrupted that the only
recourse was to boot up my duplicate, erase the corrupted drive and
duplicate back. I've also had a three-old drive begin to go sour and had to
rely on the duplicate until I got a replacement drive. Then it was a very
simple matter to duplicate the cloned drive onto the new drive.
This is precisely what I do too. Full re-write backup every two weeks after
copying the current one to a second backup. I always have 2-4 weeks of daily
incremental backups. And I've only ever needed to retrieve anything twice!

I use incremental backups in addition to Retrospect Duplicated clones.

However, back to the issue of duplication/cloning:

For me and anybody else who clones volumes from one internal hard drive to
another, might there be a login AppleScript that would do the following?

On startup, allow the four volumes on the two internal drives to mount
(which is required for SMART processes that check the backup drive). Then
unmount the two volumes on the backup drive. Please?

Respectfully, Norm
 
N

Norman R. Nager, Ph.D.

I've scripted an application that unmounts the backup drive volume. All it
needs is clicking on the "Run" button on the dialogue that appears after
startup or re-start.

Can anyone suggest how to modify the following to have it run automatically?

Here's what I did so far:

Open AppleScript editor and enter:

tell application "Finder"
eject "xxxxxxxxxxxx"
end tell

(I put between the quotation marks the exact name of one of the two volumes
on my backup hard drive. I found that unmounting one of the two volumes
with the script also resulted in the unmounting of the other.)

Save as" and then scroll in format pop-up menu to "Application". Then open
System Preferences/Accounts/Start Up Items and add it.

On startup, its icon will bounce in the dock. Go up to its window on screen
and click "Run" button. That will unmount all volumes on the internal
backup hard drive.

Respectfully, Norm
 
N

Norman R. Nager, Ph.D.

Alright! I got the scripted application below to automatically unmount
without putting up a dialogue. That was done by unchecking the "startup
screen" option when doing the "save as" operation below.

Two naïve questions from a newcomer to scripting:
1. What would happen if the scripted startup item launched and it couldn't
find the named volume because the backup drive had a problem? Do I need any
other lines in the script for such a contingency?
2. What does the "startup screen" default do?

Thanks. Norm
 
N

Norman R. Nager, Ph.D.

With the help of folks at the MacOSXHints.com system forum, I answered the
the question on how to deal with the contingency that the volume is missing
when the script runs:

I inserted the following lines in the script:
else
display dialog "volume not found or is unmounted already" -- do what
you want to do an error here

So the script now looks like this
tell application "Finder"
if exists (disk "name I gave duplicate volume") then
eject "name I gave duplicate volume"
else
display dialog "volume not found or is unmounted already" -- do what
you want to do an error here
end if
end tell

And to answer my second question below, I looked up "startup screen" in the
AppleScript Script Editor/Help.

Hope this is helpful,

Respectfully, Norm
 
P

Paul Berkowitz

So the script now looks like this
tell application "Finder"
if exists (disk "name I gave duplicate volume") then
eject "name I gave duplicate volume"
not a good idea to eject text, even if the Finder allows this (?):

eject disk "name I gave duplicate volume"

[you forgot 'disk']
else
display dialog "volume not found or is unmounted already" -- do what
you want to do an error here
end if
end tell


--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Entourage you are using - **2004**, X
or 2001. It's often impossible to answer your questions otherwise.
 
N

Norman R. Nager, Ph.D.

So the script now looks like this
tell application "Finder"
if exists (disk "name I gave duplicate volume") then
eject "name I gave duplicate volume"
not a good idea to eject text, even if the Finder allows this (?):

eject disk "name I gave duplicate volume"

[you forgot 'disk']
else
display dialog "volume not found or is unmounted already" -- do what
you want to do an error here
end if
end tell

Paul, thanks very much for catching that! The script, for the benefit of
anyone who might use it, now reads as follows:

tell application "Finder"
if exists (disk " name I gave duplicate volume") then
eject disk " name I gave duplicate volume"
else
display dialog "volume not found or is unmounted already"
end if
end tell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top