• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to select Text Field for Barcode Reader input
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to select Text Field for Barcode Reader input


  • Subject: How to select Text Field for Barcode Reader input
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 16 Aug 2017 17:49:53 +1000

G’day scripters

I’m trying to select the contents of a Text Field, (Text Field 2), and insert
the input cursor into it, to accept the input from a Bar Code Reader.

Everything on the net is all about setting the text of a field, but when I
added a line to set the text to “”, the following script was ignored.

Stupid thing is, the barcodes being inserted into the number 1 Text Field, even
though I’ve moved my required Field to the top of the list, so the Barcode
Reader does work.

Any advice on how I can place the input cursor into an empty field, please???

Trying to select text field 2 has no effect. (UI Browser)

I’m also assuming the Barcode sends a return  when read and inserted into the
Field. If not, how do I recognize when the Field has the entry, and enter a
return?

I’ve no idea where I found the code below, as I’ve been laid up ill for 5
weeks, and hardly able to code, let alone remember anything I found, or was
helped with.

Another query, should I select the Field, or the Text Field Cell? Tried both.

Regards

Santa

        on runningloop:{}
                with timeout of 50 seconds
                        tell me to activate
                        # tell scanEntryField to setStringValue:”” — No good!
                        tell application "System Events" to tell process "Mail
Manager Production Reporter"
                                scanEntryFields's currentEditor's
moveToEndOfLine:(missing value)
                        end tell
                        try
                                set (my barCodeEntryValue) to scanEntryField's
stringValue() as text
                                tell scanEntryField to setStringValue:""
                        end try
                        tell application "System Events" to display dialog (my
barCodeEntryValue) as text
                        say (count of (my barCodeEntryValue)) as text
                        if (count of (my barCodeEntryValue)) > 0 then
                                my makeTable1FirstResponder:me
                        end if
                end timeout
                my firstCycle()
                return
        end runningloop:

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Quicktime replacement?
  • Next by Date: Re: AppleScript-Users Digest, Vol 14, Issue 404
  • Previous by thread: Re: QuickTime replacement?
  • Next by thread: Re: How to select Text Field for Barcode Reader input
  • Index(es):
    • Date
    • Thread