Re: 2 tricky questions


Why don’t you just have the user copy and paste the entire sting into one text field? 

Nobody wants to manually type in a registration key. 



On 10 Sep 2017, at 16:59, Brian Christmas <ozsanta@...> wrote:

G’day scripters

Two questions, if you don’t mind.

Question 1. I’m trying to make life easier for my Application users  entering  a 28 digit password, broken into 4 groups.

I’ve created a window with 28 text fields, of 4 groups, each field of which will allow the entry of 1 digit.

I can start at the leftmost field, but want to move to the next right after ‘return’. I’ve assigned every field a missing value property, Entry1, Entry2, Entry3,  etc through to Entry28. For some reason, I cannot finf any way of actually naming them. Seems to be missing.

However, I’m trying to retrive the value of the Referncing Outlet, so I can get the numeric value on the end, and add 1 and move to the next field.

Never had to do it before, and cannot work out how.

‘Name’ does not work. Any thoughts, or suggested changes to methods used?

on checkthecode2:sender
set y to sender
set c to y's stringValue() as text
if (count of characters of c) > 1 then set y's stringValue() to character 1 of c
say 3
set n to y's name as text — Naturally fails
say 3.1
tell application "System Events" to display dialog n
say 4
set nn to characters 6 through -1 of n as text as integer
say nn
if nn as integer < 28 then
say 6
makeFirstResponder_(text field("Entry" & ((nn as integer) + 1)))
end if
end checkthecode2:

Question 2. with the entries, I’m  restricting each field to one digit, but is there any way of automatically moving to the next text field once one number is entered? AND, could I still select and  edit that number? Tall order I think, but I know some App distributors manage it somehow.

Thanks for reading, and why can’t I simply set a name for the text boxes? Nothing showing! Do I need to assign each one a named property? Still can’t assign to a name! And Titles display in the fields!



Join to automatically receive all group messages.