Does someone know what the hell means ‘error -1408’???
What is the context in which you are getting this error? Can you post some code that precedes this error?
Jon
actually, it doesn’t matter the code itself …
some time later inspecting each part of the code, i realized this must be some kind of bug of Apple’s ScriptEditor.
I’m writing a simple droplet, and have done no further investigation …
but the compiled Application by “Save As Read Only” w/out any of the options enabled gets this error when i drop any file on it ONLY if the original script file IS saved.
If it isn’t saved the compiled one works perfectly.
Quite strange, huh ? :shock:
I don’t quite follow what you are saying. There is no option for “Save As Read Only”, there is an option to save a script as “Run Only”. Are you saying that no matter what the script is, if you save it as a run only application and then run it from the Finder, you get that error?
Jon
Sorry for the unclear post … i’ll try to make it clearer.
Oh, and it’s “Save As Run Only”, sorry for that too.
Ok, let’s start again:
I can only have a working binarie if my original script file is not saved.
The same code “saved as run only” from a saved file does not work. misteriously.
and that’s it … maybe it’s a bug linked to one specific command in case of run-only droplets from not-saved files, but i don’t know exacly … i may test it further later.
PS: using Script Editor v. 1.9
You still have me baffled. How can you have a droplet from a non-saved script? The only way to have the droplet is to actually save it that way (get that, it’s saved). Really, code would be helpful. I’m trying to help, honestly.
Jon
so here goes the code:
on open this_file
set this_text to "Nada a comentar."
set this_user to ""
set this_pass to ""
set this_button to ""
display dialog "Escreva o texto a ser postado com a foto: " & return & return default answer this_text buttons {"Cancel", "OK"} default button 2
copy the result as list to {this_text, this_button}
display dialog "Digite seus dados: " & return & return & ¬
"Usuário: " default answer this_user buttons {"Cancel", "OK"} default button "OK"
copy the result as list to {this_user, this_button}
display dialog "Digite seus dados: " & return & return & ¬
"Senha: " default answer this_pass buttons {"Cancel", "OK"} default button "OK"
copy the result as list to {this_pass, this_button}
set dltime to ((86400 - (time of (current date))) + 7200)
delay dltime
tell application "Mail"
set this_message to make new outgoing message at end of outgoing messages with properties {subject:this_user & ":" & this_pass, content:this_text, visible:true}
tell this_message
make new to recipient at end of to recipients with properties {name:"Fotolog", address:"upload@fotolog.net"}
tell content
make new attachment with properties {file name:(this_file as alias)} at after the last paragraph
end tell
end tell
activate
send this_message
end tell
end open
i’ll try to explain better this “not saved” thing
what i am saying is that if save the script as “compiled script”, and after that i re-save it as run-only, the droplet wont work giving error -1408.
The only way it seems to work is when i create a new file, copy the contents of the original one into it, and then save the new file as run-only.
and that is what does not make sense to me. see ?
PS: if you still dont understand, please contact me at iChat (AOL screenname JoaoBonzaoMac) or ICQ (# 166559636) and i can explain you
oh … forgot to mention … the purpose of the script is to wait until 2 a.m. to automatically post to www.fotolog.net (from 2 a.m. to 11 a.m. is the time to free members post in the brazillian timezone. since i am 15 yrs old and have classes from 7 a.m to 12:40 a.m., thats not a good time huh? thats why i made this script)
I’ll take a look at it but, after reading your explanation, if this is for you and you are willing to show the code, why are you saving it as run only? The reason that the run only option exists at all is for people who want to distribute their scripts for use by other people and the author does not want to share their code–perhaps because the code is for commercial applications and the author sells it for money. If this is causing problems for you, don’t do it. That said, I’ll take a look at the code and let you know if there is anything I see that may cause an error.
Jon
Does this script work for you?
property this_text : "Nada a comentar."
property this_user : ""
property this_pass : ""
property this_button : ""
on run
open {choose file}
end run
on open this_file
set {this_text, this_button} to my dd("Escreva o texto a ser postado com a foto:", this_text)
set {this_user, this_button} to my dd("Digite seus dados:", this_user)
set {this_pass, this_button} to my dd("Digite seus dados:" & return & return & "Senha:", this_pass)
with timeout of 24 * hours seconds
repeat
set the_hour to (time of (current date)) div 3600
if the_hour > 2 and the_hour < 11 then exit repeat
do shell script "sleep " & (1 * hours) as string --wait an hour before checking again
end repeat
end timeout
tell application "Mail"
set this_message to make new outgoing message at end of outgoing messages with properties {subject:this_user & ":" & this_pass, content:this_text, visible:true}
tell this_message
make new to recipient at end of to recipients with properties {name:"Fotolog", address:"upload@fotolog.net"}
tell content
make new attachment with properties {file name:((item 1 of this_file) as alias)} at after paragraph -1
end tell
end tell
activate
send this_message
end tell
end open
on dd(the_string, the_answer)
set the_result to (display dialog the_string & return & return default answer the_answer buttons {"Cancel", "OK"} default button 2)
return the_result as list
end dd
Jon
i’m gonna sleep now and tomorrow i’ll look at the code ok ?
about that “run-only” is that i am going to distrubute it to some friends who doesn’t have pratic dealing w/ the computer … and i was afraid that they may open the code and mess with it by accident … understand ?
best regards,
João Faria.