Table selected cell / File dialog

Viewing 1 reply thread
  • Author
    Posts
  • March 16, 2025 at 1:11 AM #51714

    Josef Senti
    Participant

    Hello

    1.) Is there a way to find the selected cell in a column from a table field? (image attached)
    2.) Can I cal a File open window to select a file on my hard drive to get a UNIX file path?

    I’d like to write a script that can write the path of a file in a selected table cell.
    Or by input window, but ideally with a window that let me select the file on the hard drive.

    For example:

    Open file search window
    Get the UNIX path of that file
    Add “file://” in front of that path
    Look for the selected cell in the column
    Write the path in that cel

    Attachments:
    You must be logged in to view attached files.
    March 16, 2025 at 4:58 AM #51716

    Daniel Leu
    Participant

    1.) Is there a way to find the selected cell in a column from a table field? (image attached)

    AFAIK, the select state of a cell or row is not exposed.

    2.) Can I call a File open window to select a file on my hard drive to get a UNIX file path?

    To open Finder, you can use Utils.openUrl("file:///Users/josef/Desktop");. For this to work, you need to set the script access folder.

    To get the file path, control-click, middle mouse button, or two-finger click on the file to get the context menu, press the option key and select Copy “xxx” as Pathname.

    Then you can write a script that gets the copied Pathname from the clipboard using Utils.copyTextFromClipboard() and proceed with processing it. To trigger the script, you can use a checkmark field like you launch the play in VLC script.

    You can automate this further: Create an AppleScript that is selected from the Quick Actions context menu. This script would get the file path and then call a TapForms script using tapformz://script/db-xxxx/frm-xxxx/Test+Script?option1=A&option2=B. Most likely you would have to provide the id of the record and the id of the table row record as parameters. This script would then store the file path in your table.

    Sounds like a fun project!

Viewing 1 reply thread

You must be logged in to reply to this topic.