What is " NSCANNOTCREATECOMMAND error" ?

Hi,

Can anyone tell me what this error is please?
I know it is an error of creating a map or a folder, but I don’t have any clu what it realy is and what the solution about it is…

thanks!

Lee:

How about posting the code that generated the error? That would be most helpful.

Applescript:
tell application “Mail”
activate

set open_file to choose file with prompt “Choose a file containing the messages”
set file_path to open_file as string
set file_rate_size to size of the open_file
set file size to true
if the file_rate > 1.0E+9 then
set the file_rate_1 to (the file_rate div 1.0E+9)
set the file_rate_2 to (the file_rate mod 1.0E+9) div 100000000
set the file_rate to (the file_rate_1 & “.” & the file_rate_2 as text) & " GBytes"
make new folder at (path to desktop folder) with properties {name:“theFolder_1”}
adding folder items to theFolder_1 after receiving fileList

else if the file_rate > 1000000 then
set the file_rate_1 to (the file_rate div 1000000)
set the file_rate_2 to (the file_rate mod 1000000) div 100000
set the file_rate to (the file_rate_1 & “.” & the file_rate_2 as text) & " MBytes"
make new folder at (path to desktop folder) with properties {name:“theFolder_2”}
adding folder items to theFolder_2 after receiving fileList

else if the file_rate > 1000 then
set the file_rate_1 to (the file_rate div 1000)
set the file_rate_2 to (the file_rate mod 1000) div 100
set the display_text to display_text & “File Size: " & " KBytes” & the file_rate & return
make new folder at (path to desktop folder) with properties {name:“theFolder_3”}
adding folder items to theFolder_3 after receiving fileList

else
set the file_rate to the file_rate & " Bytes"
end if

set the display_text to display_text & "File Size: " & the file_rate & return
display dialog the display_text buttons {“Show File”, “OK”} default button 2
if the button returned of the result is “Show File” then
tell application “Finder”
activate
try
reveal file open_file
on error
display dialog “The movie file cannot be shown.” buttons {“OK”} default button 1
end try
end tell
end if

display dialog “Wenst u één van de folders openen?” with icon note buttons {“Ja”, “Neen”} default button 1

set newfiles to {“kleine berichten”, “matig grote berichten”, “grote berichten”}
set foldername to newfiles

choose from list newfiles with prompt “Kies uit de volgende folders” & foldername

if newfiles = “kleine berichten” then
opening folder theFolder_1(path to documents folder)
else if newfiles = “matig grote berichten” then
opening folder theFolder_2(path to documents folder)
else if newfiles = “grote berichten” then
opening folder theFolder_3(path to documents folder)
end if
end tell

thnx

Lee:

I believe the main issues lie in this section of code:

 set open_file to choose file with prompt "Choose a file containing the messages"
   set file_path to open_file as string
   set file_rate_size to size of the open_file
   set file size to true

There should be no reason to choose a file from within a Mail tell, but perhaps you are looking for a folder of messages?

this line:

set file_rate_size to size of the open_file

will also not function as it is written. You must use the Finder to get the size of a file:

tell application "Finder" to set file_rate_size to size of 

When you set the variable file_rate_size, you never refer to it again, but there are plenty of references to the variable, file_rate, was that an oversight?

I will also admit up front that I do not know what this line is trying to do:

set file size to true

Later in the script, when you try to make new folders, you must put those in a Finder tell as well:

make new folder at (path to desktop folder) with properties {name:"theFolder_1"}

should be written as:

tell app "Finder" to make new folder at (path to desktop folder) with properties {name:"theFolder_1"}

Could you please elaborate a bit on what you are trying to achieve? From my point of view, it appears that you are trying to choose a folder, or a mailbox of messages?

It is also help to post your code within the Applescript brackets in these posts; it makes it much easier to others to evaluate on their machines. Just click the Applescript button on the line above the smilies above the Message window, and two brackets will appear. Paste your code in between the brackets.