Search Results for 'script'
-
Search Results
-
Topic: Probably a stupid question
I am very new to tapforms having just downloaded the trial on my Mac and then just bought the iOS version this morning and all my playing so far has been on iPhone.
Basically I want to use it to keep a database of movies but not really in the sense of a standard movie database. I basically want to keep track of which tracks on a blu ray disc are which.
so I basically backup all my physical discs and either store them as entire backup folders or ISO for playback in home theatre. I also sometimes make an mkv instead and one of the issue with creating an mkv file from a blu ray disc is that a blu ray disc is full of playlist and video files and they are joined up in a certain way to give you the episode or movie you want to watch. If you don’t have the menus (because you are trying to pull a movie or an episode out of the whole disc and save it as a single mkv file) then it can be hard to keep a track of which playlist is the one you want. Once I have figured this out I want to keep the data.
so basically I have a video form which represent a movie or episode or equivalent. That form has some fields (eg. mpls, title, type etc). The mpls is the playlist file that is the one I care about in this instance. An mpls file links 1 or multiple m2ts files together to give you the video you want. So I have a table inside the form as well with the list of segments that make up this video. So far so good.
Then each m2ts file contains a number of streams (video, audio and maybe subtitles). Right now I have this as another table.
ok, so far so good.
So, now I can have another form for a physical disc that can link to a number of these video forms to represent the individual videos I care about on that disc. So that means I can quickly lookup and find out all the different info about the streams and segments.
So that table describes the videos on a disc that I care about and that’s part of what I want.
but now I also want another form that I will call MKV which I want to represent each mkv file I create from these videos. So when I take a video form item I will extract the video and make an mkv file so the mpls and m2ts segments used to make that mkv file are the same between the 2 forms so I can just join or link. However the tricky thing is that when I make an mkv file I do not keep all the streams. I just take the streams I want (ie. The video, the English, maybe the Japanese and some or none of the subtitles). So when I create a new MKV form I would like it to point to my “Video” form which has all the mpls and segment info and they are the same but then I want to select some of the streams from the stream table that is in the video form and I can’t figure out how to do it. Each time I create an mkv it would need to be a manual human action to tick the ones I want or something similar and then have them stored in the mkv form as a table. The data stored for each stream can be the same but I just don’t want all streams. The closest I could think of was some sort of pick list that I could populate with a table form another form. It would still be uglier than I would like but it might be ok but it also doesn’t work as I can’t populate a picklist with the contents of a table in a specific video form entry.
Is there some way to script what I want? I guess I could create a separate stream form that is keyed by the video title and then within the “video” form I can use a join to collate them all back up into a full list and then have some sort of 1 to many table in the mkv table so I can select all the streams I want?
is this the best/only way to do it?
im not sure if I’ve totally lost everyone with my rambling description….
any advice appreciated!
Hi,
When in a Custom layout, if I go to print and use the Save as PDF function, is it possible to give a tile different than the layout?
It’s an invoice layout, so I’d like it to have a formatted title like “YYMMDD_ClientName-Inv#”.
Is this something possible? Maybe with a script, I don’t know.
What do you think?
Thanks.
Hello everyone, I have an amount search script in the table field of all records. But it works for me with some quantities and not with others. And I don’t understand why.
This is the script:// Definiciones de IDs de campos dentro de la tabla
var pagos_cobros_tabla_id = ‘fld-a878bb1af5534101bcfab905279b1180’; // ID del campo Pagos/Cobros dentro de la tabla
var movs_banco_tabla_id = ‘fld-57a5fdcd593e46b298948845321d78ac’; // ID del campo Mvtos. Banco dentro de la tabla
var fecha_id = ‘fld-547c13e982e84d0793b0aba6c220cf76’; // ID del campo de fecha dentro de la tabla
var nombre_id = ‘fld-baf116cd116e4cde9b65e79014a49f28’; // ID del campo de nombre dentro de la tabla
var tabla_id = ‘fld-d8a58dbf35914f3c858c6dfb880c1c48’;
var nota_id = ‘fld-7918261f865b489a8f7672cf733712a9’;
var listado_de_script_id = ‘fld-555622f4bf0344f9b9e92af0806210fc’;
// Reemplazar ‘XXXXXX’ con el ID del campo “Listado de script”// Define el importe a buscar
var buscarImporte = “19.99”; // Ajusta este valor según el importe que desees buscarconsole.log(“”);
console.log(“*************************************”);
console.log(“Importe buscado: ” + buscarImporte);
console.log(“*************************************”);
console.log(“”);// Inicializar el contenido del campo “Listado de script”
var output = “”;// Función para parsear el importe independientemente del formato
function parseImporte(importeStr) {
if (typeof importeStr === ‘string’) {
return parseFloat(importeStr.replace(/[^\d.-]/g, ”)) || 0; // Devolver 0 si el valor no se puede convertir a número
} else {
return parseFloat(importeStr) || 0; // Devolver 0 si el valor no se puede convertir a número
}
}buscarImporte = parseImporte(buscarImporte);
var records = form.getRecords();
for (var i = 0; i < records.length; i++) {
var record = records;
var registrosTabla = record.getFieldValue(‘fld-d8a58dbf35914f3c858c6dfb880c1c48’) || []; // Reemplaza ‘tabla_id’ con el ID del campo de la tabla
var nombre = record.getFieldValue(‘fld-baf116cd116e4cde9b65e79014a49f28’); // Obtener el nombre fuera del bucle de la tabla// Array para almacenar los movimientos correspondientes a cada nombre
var movimientosNombre = [];for (var j = 0; j < registrosTabla.length; j++) {
var registroTabla = registrosTabla[j];
var pagosCobros = parseImporte(registroTabla.getFieldValue(pagos_cobros_tabla_id));
var movsBanco = parseImporte(registroTabla.getFieldValue(movs_banco_tabla_id));
var fechaRaw = new Date(registroTabla.getFieldValue(fecha_id));
var fecha =${('0' + fechaRaw.getDate()).slice(-2)}/${('0' + (fechaRaw.getMonth() + 1)).slice(-2)}/${fechaRaw.getFullYear().toString().substr(-2)};
var nota = registroTabla.getFieldValue(nota_id);// Comparar el valor absoluto de los importes
if (Math.abs(pagosCobros) === Math.abs(buscarImporte) || Math.abs(movsBanco) === Math.abs(buscarImporte)) {
movimientosNombre.push({ fecha: fecha, movsBanco: movsBanco, pagosCobros: pagosCobros, nota: nota });
}
}// Mostrar el nombre y luego los movimientos correspondientes
if (movimientosNombre.length > 0) {
output += “\n” + nombre + “\n\n”;
console.log(“” + nombre);
console.log(“”);
for (var k = 0; k < movimientosNombre.length; k++) {
var movimiento = movimientosNombre[k];
output +=${movimiento.fecha}: ${movimiento.movsBanco} | ${movimiento.pagosCobros}\n\n${movimiento.nota}\n;
console.log(${movimiento.fecha}: ${movimiento.movsBanco} | ${movimiento.pagosCobros});
console.log(“” + movimiento.nota);
console.log(“”);
}
}
}// Actualizar el campo “Listado de script” del primer registro con el texto generado
record.setFieldValue(listado_de_script_id, output);// Guardar los cambios en los registros
form.saveAllChanges();Any help will be welcome.
Hi Everyone,
I am new to Tapforms and experimenting right now with JavaScript. Is there an option to run a Script automatically during the “normal” saving process?
Thanks for your Help.
Hannes
I would like to know if this will be possible sometime. Now I have to copy lists and paste them on another app. It would be better can print directly.
thank you.I am trying to learn to use loops in JavaScript combined with a saved search. I have been able to create a script that can obtain the required data from fields in records found by a saved search. However, I cannot write some data to a field for the records found by a saved search.
Could I have some help in identifying what is wrong or what needs adding. The sample database is attached.
// Fields var date_id = 'fld-93ed9225fc674e7c840266726e160538'; var first_name_id = 'fld-edfdac34b4de4df79e5aced3c3ddc9be'; var completed_id = 'fld-6a9df78c9df744e292f47e11077d3d6d'; var client_name_id = 'fld-ec4fb9b85cb54d52813a9cd69c08198f'; // Push variable var txt = []; // Getting saved search var saved_search = form.getSearchNamed('Completed'); // get the records for the saved search var dupes_search = saved_search.getRecords(); // Looping through the records for the saved search for (var index = 0, count = dupes_search.length; index < count; index++){ var dupes_search_details = dupes_search[index]; // getting the contents of fields var completed = dupes_search_details.getFieldValue(completed_id); var client_name = dupes_search_details.getFieldValue(client_name_id); // writing data to fields dupes_search_details.setFieldValue(first_name_id, "Johnny"); //dupes_search_details.setFieldValue(date_id, "2024-03-06"); // putting data from fields together txt.push((index+1) + ". " + client_name + " = " + completed + ", and the count of records found by saved search: " + count + "\n"); } txt.join(); console.log(txt);