Re: [BUG] opening a text file twice
Last Modified
In Response To
5/14/1998; 8:35 AM by John Delacour
(#Top of Thread.)
Reply To This Message [Edit]
1.
Related to the bug that Matt mentions seems to be that the file is not seen to be busy. For example:
f = frontier.pathString + "trashme"; editor = file.findApplication('TBB6'); // or 'MSWD' frontierName = file.fileFromPath(frontier.getProgramPath()); with file { writeWholeFile(f,"hello"); setType(f, 'TEXT') ; setCreator(f, 'ttxt')}; filemenu.open(f); launch.appWithDocument(editor,f)
Now Tex-Edit Plus will never open a file that is busy in another application and Microsoft Word will always refuse with a warning. The above script allows either of them to open what *ought* to be a busy file.
2.
Doug has said that the big bug mentioned in my message:
Date: Fri, 8 May 1998 12:27:30 +0100 To: Frontier Central <Frontier-Central@scripting.com> Subject: Bug opening files (again)
will be fixed.
3. In Windows it should be possible to drag a text file to a frontier.exe shortcut icon in the task bar, hold it there until the cursor changes (Frontier activates) and then move the cursor to Frontier's space. The file should then open in Frontier. Try it with any other application. It does not work in Frontier.
4. The File menu is an example of something that can remain very buggy for a very long time when not exposed to the scrutiny of users. When a filebased object's window is frontmost the Save item should either put up a dialog asking the user if he wants to save the object or save the database or respond to a user preference as to what action to take in these circumstances.
A scripted filemenu.close should confirm save before closing a file.based window, as should window.close(@root). The user cannot be expected to predict the abnormal behavior of Frontier in these cases.
f = frontier.pathString + "trashme"; try{window.close(@[f])}; frontierName = file.fileFromPath(frontier.getProgramPath()); with file { writeWholeFile(f,"Unchanged"); setType(f, 'TEXT') ; setCreator(f, 'ttxt')}; filemenu.open(f); while not (window.frontmost() == @[f]) {sys.systemtask()}; window.update(@[f]) ; clock.waitSeconds(1); // Without the while loop, we get // Can't do "wp.settext" because the target window is not // in edit mode or does not contain editable text. // Without the update the "unchanged" text is not shown wp.setText("Modified"); window.update(@[f]) ; clock.waitSeconds(1); // Without the update the new text is superimposed on the old filemenu.save(); // The file is not saved dialog.notify(file.readWholeFile(f)); filemenu.close(); // No Save dialog is given dialog.notify(file.readWholeFile(f))
J
Enclosures
None.
Replies
None.