AppleScript and/or Javascript Library?

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Script Talk AppleScript and/or Javascript Library?

Viewing 3 reply threads
  • Author
    Posts
  • January 4, 2021 at 2:57 PM #43049

    Mike Kilmer
    Participant

    Hi, Brandan and TapForms community.

    I have an AppleScript I developed a few years ago for sending emails to selected entries in Mac Contacts that I was looking to migrate to TapForms.

    This script looks like this:

    set myMessage to "Hi, here's a newsletter...
    
    Thanks and I hope you are doing magically and wonderfully.
    
    Blessings, Mike.
    https://example.com
    "
    
    set mySubject to "Engaging Subject"
    
    display dialog "Please select the recipients in Address Book/Contacts"
    
    tell application "Contacts"
        set theContacts to selection
        repeat with contact in theContacts
            set contact_name to name of contact
            if first name of contact is missing value then
                if name of contact is not missing value then
                    set contact_addressed_as to name of contact
                else
                    set contact_addressed_as to "stranger"
                end if
            else
                set contact_addressed_as to first name of contact
            end if
            my send_message(mySubject, "Hey " & contact_addressed_as & ",
    " & return & myMessage, value of first email of contact)
            delay 10
        end repeat
    end tell
    
    on send_message(theSubject, theBody, theAddress)
        tell application "Mail"
            set theNewMessage to make new outgoing message with properties {sender:"Mike iLL <mike@madhappy.com>", subject:theSubject, content:theBody & return & return, visible:true}
            tell theNewMessage
                set visibile to true
                make new to recipient at end of to recipients with properties {address:theAddress}
                delay 3
                send
            end tell
        end tell
    end send_message
    display dialog "Sent batch ending with " & contact_name & "." buttons {"OK"}

    I changed the App name to Tap Forms 5, but before I get into the current error (okay it’s Expected class name but found identifier), I had seen a reference to a “Tapforms AppleScript Library” somewhere in the forums, but can’t find that.

    Additionally, I’m more adept at JavaScript and see that there’s an API for using that. Are there resources I should know about beyond the API reference in the docs?

    Thanks and I’m excited to, after three years, finally be getting back into using the app (which is up to date).

    January 4, 2021 at 8:20 PM #43053

    Brendan
    Keymaster

    Hi Mike,

    The scripting in Tap Forms is designed more to facilitate working with your data within the database. But there are some Utils functions which might help you with something like this by using the Utils.openUrl() function. You could build a mailto: link in code and use a script to call it.

    Thanks!

    Brendan

    January 4, 2021 at 9:43 PM #43055

    Mike Kilmer
    Participant

    Thanks, man. And is the Tapforms AppleScript Library either a thing of the past, figment of someones imagination?

    January 6, 2021 at 1:06 AM #43072

    Brendan
    Keymaster

    The AppleScript feature is still there, but it was primarily meant for firing off a Form Script in Tap Forms from an AppleScript. Although you can also query for a list of forms and such. The AppleScript dictionary will tell you what’s available.

Viewing 3 reply threads

You must be logged in to reply to this topic.