Search Results for 'script'
Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Search › Search Results for 'script'
-
AuthorSearch Results
-
April 28, 2021 at 8:30 PM #44262
In reply to: EXIF editor you could recommend
Sam Moffatt
ParticipantIf 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.April 28, 2021 at 9:36 AM #44261In reply to: Using Shortcuts on iOS
Daniel Leu
ParticipantOne 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 Linkin 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&tricksApril 23, 2021 at 1:09 AM #44235Sam Moffatt
ParticipantI 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.
April 21, 2021 at 11:23 PM #44234In reply to: Check on empty blob field
Daniel Leu
ParticipantI’m glad I added scripting then Daniel! :)
:)
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricksApril 21, 2021 at 10:12 PM #44233In reply to: Check on empty blob field
Brendan
KeymasterI’m glad I added scripting then Daniel! :)
April 21, 2021 at 7:49 AM #44232In reply to: Check on empty blob field
Daniel Leu
ParticipantHi 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&tricksApril 21, 2021 at 5:23 AM #44231In reply to: Open a Finder window
raily74
ParticipantHello 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.
April 21, 2021 at 4:42 AM #44229MiB
ParticipantThank 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.April 20, 2021 at 11:08 PM #44227In reply to: Check on empty blob field
Dirk Soenen
ParticipantHi 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.
April 20, 2021 at 5:41 PM #44226Sam Moffatt
ParticipantIndeed! Good news you got it sorted and you’ve begun your Tap Forms scripting journey!
April 20, 2021 at 5:36 PM #44225Sam Moffatt
ParticipantSounds 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?
April 20, 2021 at 2:50 PM #44223In reply to: Grab name from iOS Contacts record?
Daniel Leu
ParticipantYour contact field returns just a regular javascript object. To get the name, you can use
contact.nameorcontact["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&tricksApril 20, 2021 at 2:28 PM #44222Topic: Grab name from iOS Contacts record?
in forum Script TalkFern
ParticipantIs 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
April 20, 2021 at 2:13 PM #44221Fern
ParticipantThis 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!
April 20, 2021 at 9:54 AM #44220In reply to: Check on empty blob field
Daniel Leu
ParticipantYes, 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 -
AuthorSearch Results