RE: Here's a strange one
RE: Here's a strange one
- Subject: RE: Here's a strange one
- From: Eric Schult <email@hidden>
- Date: Fri, 20 Apr 2001 10:52:01 -0600
On Thu, 19 Apr 2001 19:53:58, Daniel Robinson <email@hidden> wrote:
>
<snip> ... Occasionally, unpredictably, and on different machines, that line
>
becomes:
>
>
run script alias "Macintosh HD:Applications:Adobe Premiere
>
6.0:Help:images:spherize.gif"
>
>
or some other seemingly random file.
>
>
Part of what "Main" does, is occasionally, when Main 2 is updated, replace
>
Main 2 with a newer version. Since "With replacing" has never worked, I delete
>
the old Main2 first, then copy the new one. But that doesn't seem to cause
>
this problem ... <snip>
You are describing a phenomenon that has caused me countless migraines and
made me toil over my keyboard for seeming eons. I don't have an answer for
you, but I have a few theories I'd like to bounce off the list. When I
raised this question solo, I didn't manage to generate any replies, but that
could be because I didn't have many clues at the time, and may not have
articulated the problem adequately.
I'm using the repeat command to go through a list of PDF files, duplicating
each PDF and renaming the duplicate to "temp.pdf" so I can do a Photoshop
action on the "temp.pdf" file. Something like this:
repeat with i in pdfList
try
deleteFile "pdfPath:temp.pdf" -- requires Jon's Commands
end try
duplicate file (pdfPath & (i & ".pdf"))
set name of file (i & ".pdf" & " copy" as string) to "temp.pdf"
tell application "Adobe. Photoshop. 6.0"
activate
do script "PDF to GIF" -- GIFs the file into another folder
end tell
set name of file gifPath & "temp.gif" to (i & ".gif")
deletefile "pdfPath:tempFile.pdf"
end repeat
The above is a boiled-down version of a much more complex script, and I've
also tried substituting the deleteFile command with other alternatives, such
as delete file and rename and replace, etc.
It works flawlessly for days and days, and then suddenly the Photoshop
Action starts opening the wrong file (say, "12345.pdf") over and over again,
and saving a gif of that file as (i & ".gif") in the gifPath folder.
Or, it opens the "temp.pdf" file, but instead of saving it as (i & ".gif")
in the gifPath folder, it saves it as "12345.gif" in some random other
place.
Confounding and fascinating to me is that after this phenomenon occurs, it
even happens when you run the Photoshop Action independently of the script.
You have to re-record the Action in Photoshop, or delete the "12345.pdf"
file in the pdfPath to get the Action to behave again. Then you can run the
script successfully for a couple more weeks.
I have been frittering around endlessly with error handlers on the theory
that the script is encountering a busy file when it is trying to delete the
temp.pdf. If the Photoshop Action starts chugging along on a fairly large
pdf, and isn't finished when the script repeats the loop, the script could
fail on the deleteFile command. That doesn't explain, however, how the
Photoshop Action itself is corrupted, or why the script doesn't simply
generate an error, instead of finding a new file (by index?) to mess with.
I'm also focusing on whether a busy network, or a fairly regular condition
in which the network trash has been deleted, could be the culprit. If that
were the case, we'd still be talking about the script erroring because the
"temp.pdf" was busy.
Dan, it really sounds to me like your problem and mine are related. Can
anyone on the list venture a theory or offer a fix?
wes