Tap Forms app icon half
Tap Forms Forum text image
Blue gradient background

Exchange tips and ideas with the Tap Forms community

Search Results for 'script'

Viewing 15 results - 1,351 through 1,365 (of 2,989 total)
  • Author
    Search Results
  • #44262
    Sam Moffatt
    Participant

    If there isn’t a need to do write access, read only access via the scripting API might make sense. Potentially something wrapping NSImageEXIFData might be interesting: https://developer.apple.com/documentation/appkit/nsimageexifdata?language=objc

    I tried last night to see if I could use a native JS implementation to do something with the data but couldn’t figure out a way to get to the image attachment from JS. I then tried to download via Utils.getDataFromUrl() but couldn’t bridge the gap with the JS EXIF library I picked up.

    #44261

    In reply to: Using Shortcuts on iOS

    Daniel Leu
    Participant

    One way of using tapformz:// is calling a TapForm script from an external application. This is document in https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api under the paragraph “Calling a script from a URL”.

    Another use is to open a record. On the desktop, Copy Record Link in the Edit menu copies the URL needed to the clipboard. It has the form :tapformz://record/view/db-xxx/frm-xxx/rec-xxx.

    On mobile, when you show a record, click on the menu on the top right, select Copy Record Link.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    Sam Moffatt
    Participant

    I think you should learn some JavaScript as well, you’ve already started the journey, it’d be a shame to end it here! You started off in your OP not confident you could do it though now you end it with a bona fide Tap Forms bug under your belt and your first successful script!

    Humble Bundle are currently doing a sale on O’Reilly’s Head First series which includes their Head First JavaScript book along side a bunch of other books. Head First has a slightly different approach in their books and the bundle level to get the JavaScript book is $10. That book, like most Javascript resources, focuses on Javascript in web development but a lot of the language features and functionality apply to Javascript in Tap Forms as well. Also at the $10 tier is their Learn to Code book which uses Python as an introduction language and might also be helpful in learning how to code. Each programming language has their own quirks which is the fun part in writing code.

    Thanks for the clearance, I’ve added it to my backlog to add to the channel.

    #44234
    Daniel Leu
    Participant

    I’m glad I added scripting then Daniel! :)

    :)

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #44233
    Brendan
    Keymaster

    I’m glad I added scripting then Daniel! :)

    #44232
    Daniel Leu
    Participant

    Hi Dirk, welcome to scripting! Without scripting, I wouldn’t be a TapForms user!

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #44231

    In reply to: Open a Finder window

    raily74
    Participant

    Hello Brendan, hello Sam,

    after a week in the test with folder alias and Script Folder Access, both ways come to problems. In both cases it seems to be a bug.

    1. The way over the folder alias (Brendan)
    In Tap Forms, I double-click on the alias to get to the Finder folder. In case of creating a new subfolder or changing the name of an existing one in finder, I then have two aliases in Tap Forms of which the lower only works. So I always have to delete an alias after such an action.
    In case of creating a new subfolder without using the alias before, every works fine. But than I have to search for the folder manually.

    2. The way over the URL (SAM) – my preferred way
    If the Script Folder Access is set once, it works fine as described last week. As soon as I restart Tap Forms, it doesn’t work anymore. I first have to define the Script Folder Access again in the preferences.

    Would be nice to get this working because it’s very important to me. There are a lot of files I don’t want to sync to iOS. So it would be nice to get to finder with one click (URL) ore with double-click (alias) and without errors.

    Thanks a lot for your help.

    MiB
    Participant

    Thank you, I’ve changed that.
    Of course you can use whatever you wish from this conversation. I have learned a lot, and it was fun. I think, I should learn some java script, just for fun. :-)
    I will attach the latest files. You can use them in your video if you like.
    – Or everybody else, who is reading here. You just have to change the username “mib” to your own in the Script and in the command file.

    Attachments:
    You must be logged in to view attached files.
    #44227
    Dirk Soenen
    Participant

    Hi Daniel,

    Thanks for your response. I’ve never used scripts, this is definitely the moment to explore. I’m starting with the tap forms javascript scripting 101 manual today. Never too old to learn.

    #44226
    Sam Moffatt
    Participant

    Indeed! Good news you got it sorted and you’ve begun your Tap Forms scripting journey!

    Sam Moffatt
    Participant

    Sounds good!

    One other thing I noticed you created the script as field script, I think you should recreate it as a form script. Form scripts are intended to be run on demand which fits this case more. Script fields update when a referenced field changes and are more intended to work with the individual records.

    Once Brenden’s done the public release, I’ll do a video with this. Do you mind if I use your use case and sample data as an example?

    #44223
    Daniel Leu
    Participant

    Your contact field returns just a regular javascript object. To get the name, you can use contact.name or contact["name"].

    Example:

    function Get_Contact_Name() {
    	var contact_id = 'fld-xxx';
    	var contact = record.getFieldValue(contact_id);
    	return contact["name"];
    }
    
    Get_Contact_Name();

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #44222
    Fern
    Participant

    Is there a way to grab only the name of the linked Contact? (I’d love to not have to manually enter a contact’s name; I’ve just been linking to a record in iOS’s Contacts.)

    With my almost nonexistent knowledge of scripting, I’ve only gotten it to return the entirety of the iOS record, i.e.{ id = “blablabla”; name = “blablabla”; phoneNumbers = {home = blablabla; mobile = blablabla;};} etc

    #44221
    Fern
    Participant

    This is my first time using scripts in TapForms and I figured out how to adapt Daniel’s version to my forms and where to put it! (Funnily enough I figured out the former first…) This is run-of-the-mill for people like you and Daniel, but it’s a total achievement for me. Thank you so much for your help!

    #44220
    Daniel Leu
    Participant

    Yes, you can check this in a script:

    function Has_Photo() {
    	var photo_id = 'fld-xxx';
    	var photo = record.getFieldValue(photo_id);
    	
    	if (photo.length == 0){
    		return "has no photos";
    	} else {
    		return "has " + photo.length + " photos";
    	}
    
    }
    
    Has_Photo();

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

Viewing 15 results - 1,351 through 1,365 (of 2,989 total)