Unable to edit a button LiveCode 9.6.4
Moderator: Klaus
Unable to edit a button LiveCode 9.6.4
Hi,
Not sure if this is the correct forum, but I recently created button to send an email by script using:
put tsNetSmtpSync(tURL, tFrom, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult
After editing the script and closing the script editor and saving the stack, I am unable to edit the button even when selecting and using the Pointer tool.
When using the Pointer tool, the button functions as if the browse tool were selected (run mode I believe its called).
I copied the script of the button and pasted to new button, same result.
I am able to edit the button with the community version of Livecode since an error is generated with the tsNetSmtpSync.
Any thoughts?
Was unable to attach the script so I pasted it as below. (except for my email credentials).
Cant even thing of anything that would cause this.
Thanks.
John Burnett
on mouseUp
local tUrl, tEmailMessage, tRecipient, tBody, tFrom, tTo, tCc, tSubject, tAttachments
local tSettings, tResult, tBytes, tResponseHeaders
answer "Send Message" && field "email_subject" with "No" or "Send"
if it is "No"
then
exit mouseUp
end if
-- Specify the e-mail server settings
put "-" into tUrl
put "-" into tSettings["username"]
put "-" into tSettings["password"]
-- Enable TLS for SMTP
put true into tSettings["use_ssl"]
-- Encode the e-mail message body
put mimeEncodeFieldAsMIMEMultipartDocument(the long id of field "email_message") into tBody
if field "attachment" is not empty
then
put field "attachemnt" into tAttachments[1]["filepath"]
end if
-- Encode the e-mail headers and body
put "DrBurnett@DrJB-MFP.online" into tFrom
put line 1 of field "eMail" into tTo
if tTo is empty
then
put line 1 of field "Phone" into tPhone
put tPhone & "@txt.att.net" into tTo
end if
put field "email_cc" into tCc
put field "email_subject" into tSubject
mimeEncodeAsMIMEEmail tBody, tFrom, tTo, tCc, tSubject, tAttachments
put it into tEmailMessage
-- Make tRecipient a list of all recipients (To and Cc)
put tTo & cr & tCc into tRecipient
-- Send the e-mail
put tsNetSmtpSync(tURL, tFrom, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult
-- Check the result
if the first word of tResult is "tsneterr:" then
answer "Error" && tResult && "returned from server"
else
answer "E-mail sent"
put "" into field "attachment"
end if
put field "Last Name" into tLastName
put field "First Name" into tFirstName
put field "Chart" into tChart
put tLastName && tFirstName && tChart into tID
put tID & tTo & tSubject & the date && the time into tSendData
if field "Notifications" of card tID of stack "Patient Data" is empty
then
put tSendData into field "Notifications" of card tID of stack "Patient Data"
else
put tSendData & return before line 1 of field "Notifications" of card tID of stack "Patient Data"
end if
end mouseUp
Not sure if this is the correct forum, but I recently created button to send an email by script using:
put tsNetSmtpSync(tURL, tFrom, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult
After editing the script and closing the script editor and saving the stack, I am unable to edit the button even when selecting and using the Pointer tool.
When using the Pointer tool, the button functions as if the browse tool were selected (run mode I believe its called).
I copied the script of the button and pasted to new button, same result.
I am able to edit the button with the community version of Livecode since an error is generated with the tsNetSmtpSync.
Any thoughts?
Was unable to attach the script so I pasted it as below. (except for my email credentials).
Cant even thing of anything that would cause this.
Thanks.
John Burnett
on mouseUp
local tUrl, tEmailMessage, tRecipient, tBody, tFrom, tTo, tCc, tSubject, tAttachments
local tSettings, tResult, tBytes, tResponseHeaders
answer "Send Message" && field "email_subject" with "No" or "Send"
if it is "No"
then
exit mouseUp
end if
-- Specify the e-mail server settings
put "-" into tUrl
put "-" into tSettings["username"]
put "-" into tSettings["password"]
-- Enable TLS for SMTP
put true into tSettings["use_ssl"]
-- Encode the e-mail message body
put mimeEncodeFieldAsMIMEMultipartDocument(the long id of field "email_message") into tBody
if field "attachment" is not empty
then
put field "attachemnt" into tAttachments[1]["filepath"]
end if
-- Encode the e-mail headers and body
put "DrBurnett@DrJB-MFP.online" into tFrom
put line 1 of field "eMail" into tTo
if tTo is empty
then
put line 1 of field "Phone" into tPhone
put tPhone & "@txt.att.net" into tTo
end if
put field "email_cc" into tCc
put field "email_subject" into tSubject
mimeEncodeAsMIMEEmail tBody, tFrom, tTo, tCc, tSubject, tAttachments
put it into tEmailMessage
-- Make tRecipient a list of all recipients (To and Cc)
put tTo & cr & tCc into tRecipient
-- Send the e-mail
put tsNetSmtpSync(tURL, tFrom, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult
-- Check the result
if the first word of tResult is "tsneterr:" then
answer "Error" && tResult && "returned from server"
else
answer "E-mail sent"
put "" into field "attachment"
end if
put field "Last Name" into tLastName
put field "First Name" into tFirstName
put field "Chart" into tChart
put tLastName && tFirstName && tChart into tID
put tID & tTo & tSubject & the date && the time into tSendData
if field "Notifications" of card tID of stack "Patient Data" is empty
then
put tSendData into field "Notifications" of card tID of stack "Patient Data"
else
put tSendData & return before line 1 of field "Notifications" of card tID of stack "Patient Data"
end if
end mouseUp
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: Unable to edit a button LiveCode 9.6.4
Surely the first thing to do is update to the latest version of LiveCode.
Re: Unable to edit a button LiveCode 9.6.4
If the button is behaving like in browse tool the it’s a good bet that its cantSelect property somehow got set to truejsburnett wrote: ↑Wed May 03, 2023 5:26 pm
After editing the script and closing the script editor and saving the stack, I am unable to edit the button even when selecting and using the Pointer tool.
When using the Pointer tool, the button functions as if the browse tool were selected (run mode I believe its called).
You can of course test in the message box:
Code: Select all
Set the cantSelect of button <buttonName> to false
Even so, you can edit the script of any object through the msgBox:
Code: Select all
Edit the script of button <buttonName>
S.
Last edited by stam on Wed May 03, 2023 7:58 pm, edited 2 times in total.
Re: Unable to edit a button LiveCode 9.6.4
Thanks for the suggestion.
Upgraded and no luck.
John
Upgraded and no luck.
John
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: Unable to edit a button LiveCode 9.6.4
At the risk of coming across as totally cretinous:
Have you tried to edit another button in the same stack?
Have you tried to edit another button in the same stack?
Re: Unable to edit a button LiveCode 9.6.4
I am not clear. When in pointer tool mode, you can invoke, say, a "mouseUp" handler in the button, as you would expect to do with the browse too? Can you also do that with the browse tool?I am unable to edit the button even when selecting and using the Pointer tool.
You have to edit the script of that button by opening its script externally (like from the message box)? Can you select the button externally?
Does a new button work normally?
Craig
Re: Unable to edit a button LiveCode 9.6.4
Thanks for all the posts and replies.
I missed the post by stam.
Yes the cantSelect property was true.
Set it to false and works like a charm.
Learned something new today, solved another problem. Great day.
Thanks.
John
I missed the post by stam.
Yes the cantSelect property was true.
Set it to false and works like a charm.
Learned something new today, solved another problem. Great day.
Thanks.
John
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Unable to edit a button LiveCode 9.6.4
Glad you got that worked out, John.
You're not the first person to have accidentally set the cantSelect.
I once tried to encourage them to swap that Inspector icon for something more commonly needed. Project Browser space is premium real estate, and things like lockLoc are far more valuable there - which is what a lock icon in a layout program usually signifies. Alas my best argument was uncompelling.
FWIW here's some background on that property:
https://forums.livecode.com/viewtopic.p ... 49#p149449
You're not the first person to have accidentally set the cantSelect.
I once tried to encourage them to swap that Inspector icon for something more commonly needed. Project Browser space is premium real estate, and things like lockLoc are far more valuable there - which is what a lock icon in a layout program usually signifies. Alas my best argument was uncompelling.
FWIW here's some background on that property:
https://forums.livecode.com/viewtopic.p ... 49#p149449
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn