MACSCRPT Archives

May 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 30 May 2007 19:37:24 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
Here's the test I ran.

I pasted this into script editor, and started running it.

------------------
set myFolder to path to startup disk
set fileName to "Sequence 1  Copy_070530035437.mov"
set myFile to ((myFolder as string) & fileName)

try
    open for access file myFile with write permission
    set openFile to the result
on error
    close access file myFile
    open for access file myFile with write permission
    set openFile to the result
end try
set x to 1
set eof of openFile to 1
repeat
    set x to x + 1
    get eof of openFile
    write x as string to openFile
end repeat
------------------

I then pasted this into Script Debugger and started running it.

------------------
set myFolder to path to startup disk
set fileName to "Sequence 1  Copy_070530035437.mov"
set myFile to ((myFolder as string) & fileName)
get eof of file myFile

set oldSize to 0
repeat
    delay 2
    try
        set curSize to get eof of file myFile
        log curSize
        if curSize is oldSize then
            exit repeat
        end if
        set oldSize to curSize
    on error errText
        log {"error @ file size check run stat script -> user canceled",
errText}
        display dialog errText
        exit repeat
    end try
end repeat
------------------


The result was no errors, and it faithfully logged the growing file size.

get eof file "Jaguar:Sequence 1  Copy_070530035437.mov"
-->    425.0
(*425.0*)
get eof file "Jaguar:Sequence 1  Copy_070530035437.mov"
-->    467.0
(*467.0*)

When I stopped the Script Editor process it gracefully exited as expected.

Is it possible there is a return character or some other odd character in
your original file name?

>>>>Here the original(not working) file name and path:
  "/Volumes/SATA_465_01/FCP6 test folder/Sequence 1
Copy_070530035437.mov"

HTH

ES

ATOM RSS1 RSS2