PDA

View Full Version : What does this Error message mean?




thriftinkid
Apr 12, 2008, 05:13 PM
I had this script working before, but I moved it to another system and changed the folder alias's accordingly but I am getting an error message. It basically reads all the files in a folder and makes them into a list to add them to a render cue of my video compression software. I posted the script and the error message below. Does anyone know what it means or how to fix it?

Script:

tell application "Finder"
set Afolder to "MacintoshHD:Users:comcastcable:Desktop:Render" as alias
set a_list to every file in Afolder as alias list
repeat with i from 1 to number of items in a_list
set a_file to (item i of a_list)
tell application "Cleaner 6.5.1" to Add a_file
end repeat
end tell

Error message:

Can't make alias "MacintoshHD:Users:comcastcable:Desktop:Render:fanaxxessbump.wmv" into type «class alst». (-1700)



numero
Apr 13, 2008, 03:31 PM
Nothing stands out on this one.

Try this:
Run it in Script Editor and have the "Event Log" showing. There will be some output for each line that runs. Let us know where the failure is.

You can also put in "log" lines. Such as: log a_file. These will print to the Event Log as well.

I'd also comment out the "tell Cleaner" line until the rest is working.

-numero

thriftinkid
Apr 14, 2008, 09:44 AM
Nothing stands out on this one.

Try this:
Run it in Script Editor and have the "Event Log" showing. There will be some output for each line that runs. Let us know where the failure is.

You can also put in "log" lines. Such as: log a_file. These will print to the Event Log as well.

I'd also comment out the "tell Cleaner" line until the rest is working.

-numero

Here is the Event Log when I ran the script:

tell application "Finder"
get every file of alias "MacintoshHD:Users:comcastcable:Desktop:Render:"
{alias "MacintoshHD:Users:comcastcable:Desktop:Render:fanaxxessbump.wmv"}
"Can't make alias \"MacintoshHD:Users:comcastcable:Desktop:Render:fanaxxessbump.wmv\" into type «class alst»."

macfaninpdx
Apr 14, 2008, 10:23 AM
It sounds like it cannot find "Cleaner 6.5.1" on the new system. I am assuming when you changed the alias to the Render folder, the script compiled properly? Did it ask you where "Cleaner 6.5.1" is?

lee1210
Apr 14, 2008, 01:28 PM
http://lists.apple.com/archives/Applescript-users/2003/Jan/msg01296.html
That response to a similar question explains that if a folder only has one item, this fails. if you add another file it would work, but that post gives a means of handling the case that there is only 1 file as well.

-Lee

thriftinkid
Apr 14, 2008, 01:45 PM
It sounds like it cannot find "Cleaner 6.5.1" on the new system. I am assuming when you changed the alias to the Render folder, the script compiled properly? Did it ask you where "Cleaner 6.5.1" is?

It never gets that far in the script to ask where cleaner is, even if it doesn't know. As goes for the only one file in the folder issue. I was running tests on the last machine with only one file and it ran fine.

lee1210
Apr 14, 2008, 01:54 PM
Was the last machine exactly the same version of OS X (This bug could have been fixed)? Are you sure there wasn't a .DS_Store file in the directory as well as the 1 file you knew of? Try adding another file and see if that fixes it. The error you get is exactly the same as what's mentioned in the thread.

-Lee

macfaninpdx
Apr 14, 2008, 02:17 PM
It never gets that far in the script to ask where cleaner is, even if it doesn't know.

If you open the script in Script Editor, can you click on the Compile button? When you compile it in Script Editor, it wlil look for any applications referenced in a Tell block. If it can't find them, it will ask you to find them for it. If it compiles, you will see your code re-format into a syntax-colored font, and that means it was able to find Cleaner.

Edit: You will need to open it in Script Editor on the new machine to which you copied the script.

thriftinkid
Apr 14, 2008, 02:44 PM
Was the last machine exactly the same version of OS X (This bug could have been fixed)? Are you sure there wasn't a .DS_Store file in the directory as well as the 1 file you knew of? Try adding another file and see if that fixes it. The error you get is exactly the same as what's mentioned in the thread.

-Lee

The other system had the new mac os 10.5. This other system has 10.4.11. Is there any huge significant changes that would effect this script?

thriftinkid
Apr 14, 2008, 02:46 PM
If you open the script in Script Editor, can you click on the Compile button? When you compile it in Script Editor, it wlil look for any applications referenced in a Tell block. If it can't find them, it will ask you to find them for it. If it compiles, you will see your code re-format into a syntax-colored font, and that means it was able to find Cleaner.

Edit: You will need to open it in Script Editor on the new machine to which you copied the script.

I compiled it in script editor with no errors.

thriftinkid
Apr 14, 2008, 02:50 PM
http://lists.apple.com/archives/Applescript-users/2003/Jan/msg01296.html
That response to a similar question explains that if a folder only has one item, this fails. if you add another file it would work, but that post gives a means of handling the case that there is only 1 file as well.

-Lee

So I ran the script again after compiling with 3 files in the folder and it ran properly. I looked at the script in the link posted above, but I don't know where to insert the script. COuld you guys help me out?

Link Script:

tell app "Finder"
try
set foos to theItems as alias list
on error -- only one item present
set foos to theItems as alias as list
end try
end tell

My Script:

tell application "Finder"
set Afolder to "MacintoshHD:Users:comcastcable:Desktop:Render" as alias
set a_list to every file in Afolder as alias list
repeat with i from 1 to number of items in a_list
set a_file to (item i of a_list)
tell application "Cleaner 6.5.1" to Add a_file
end repeat
end tell

lee1210
Apr 14, 2008, 02:56 PM
I don't have a mac handy, but I believe you want to change:
set a_list to every file in Afolder as alias list

to

try
set a_list to every file in Afolder as alias list
on error -- only one item present
set a_list to every file in Afolder as alias as list
end try

If that doesn't work, I can try it out when I get home this evening.

-Lee

thriftinkid
Apr 14, 2008, 03:48 PM
I don't have a mac handy, but I believe you want to change:
set a_list to every file in Afolder as alias list

to

try
set a_list to every file in Afolder as alias list
on error -- only one item present
set a_list to every file in Afolder as alias as list
end try

If that doesn't work, I can try it out when I get home this evening.

-Lee

Bingo. That worked. Thanks so much for helping out such a sad, lost soul among the programming genious's on this site.