Works in Debugger mode... not anywhere else. Weird.
Works in Debugger mode... not anywhere else. Weird.
- Subject: Works in Debugger mode... not anywhere else. Weird.
- From: David Jacopille <email@hidden>
- Date: Thu, 28 Aug 2003 10:38:40 -0400
I'm authoring in Script Debugger 3.0.6 on 10.2.6. I've ported this
script from OS 9 which did not have this issue.
The folder path specified by "hypoFolder" contains a folder called
"Processed" and may/may not contain text files to process. When the
folder contains ONLY the "Processed" folder (no text files) the below
try statement should not load hypoFolderContents with anything, and
thus not execute the following repeat loop.
In Script Debugger's "AppleScript Debugger" mode it works correctly.
In "AppleScript" mode, or when saving script as an application it DOES
load hypoFolderContents with 1 item (presumably the path to "Processed"
folder). The script then enters the repeat loop and fails because the
loop is only designed to handle files. Switch it back and all is well.
I've tried both "set" statements (same results) and I've done an ls -la
to check the contents and nothing has .txt in the folder.
The folder is on a Windows 2000 Server with Macintosh Services turned
on and has worked reliably for years from OS 9, as well as from
Debugger mode on OS X.
tell application "Finder"
try
set hypoFolderContents to (name of every file in hypoFolder whose
name ends with ".txt") as list
-- set hypoFolderContents to (name of every file in hypoFolder whose
file type is "TEXT") as list
on error
set hypoFolderContents to {}
end try
end tell
repeat with counter1 from 1 to count of hypoFolderContents
...
I've also tried to Display Dialog the contents of hypoFolderContents
right after it gets mistakenly loaded to identify what's being loaded
and haven't had any success. Things like
display dialog (item 1 of hypoFolderContents) as string
doesn't seem to work. Any ideas?
David Jacopille
MFS
Boston
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.