{"id":793,"date":"2025-09-22T16:21:36","date_gmt":"2025-09-22T16:21:36","guid":{"rendered":"https:\/\/protolinker.com\/?post_type=docs&#038;p=793"},"modified":"2026-04-01T21:12:54","modified_gmt":"2026-04-01T21:12:54","password":"","slug":"script-for-links","status":"publish","type":"docs","link":"https:\/\/protolinker.com\/en\/documentation\/script-for-links\/","title":{"rendered":"Script for links"},"content":{"rendered":"<h2 class=\"wp-block-heading\" id=\"how-to-create-a-script-for-a-link\">How to create a script for a link<\/h2>\n\n\n<p class=\"wp-block-paragraph \" style=\"\">Once you have a link, and you want to manipulate how the receiving tag will get the data you can add a script and make the changes you need to it, like making a unit conversion or transforming a binary number into a real value, for that you can use any script language or binary supported by your hosting operating system.<\/p>\n\n\n<p class=\"wp-block-paragraph \" style=\"\">The first step is to select the tag and find the link to the protocol tag you want to manipulate, to do so, open the Links form by either clicking the link button on the Prototocol Config form or the the bottom-right corner Links button.<\/p>\n\n\n<figure class=\"wp-block-image size-full\" style=\"\"><img fetchpriority=\"high\" decoding=\"async\" width=\"527\" height=\"550\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71.png\" alt=\"\" class=\"wp-image-1131\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71.png 527w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71-287x300.png 287w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-71-11x12.png 11w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph \" style=\"\">Then select the Sender protocol, sender tag and destination protocol for the link, with that a list of all tags on that destination protocol will appear on the Destination Tags section, and a script button will be in the line of each tag, so just click it to open the script form.<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\" style=\"\"><img decoding=\"async\" width=\"424\" height=\"439\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-78.png\" alt=\"\" class=\"wp-image-1142\" style=\"width:524px;height:auto\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-78.png 424w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-78-290x300.png 290w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-78-12x12.png 12w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph \" style=\"\">Within the script config dialog, you will need to configure the command your script need to be run, so if it is a python it should be python or sh for a bash and so on, then select the path to the script itself using the browse button, and if necessary you can add extra arguments for your script in case you are re-using it for more than one tag\/link.<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\" style=\"\"><img decoding=\"async\" width=\"421\" height=\"439\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-79.png\" alt=\"\" class=\"wp-image-1143\" style=\"width:538px;height:auto\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-79.png 421w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-79-288x300.png 288w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-79-12x12.png 12w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n<p class=\"wp-block-paragraph \" style=\"\">Some extra configuration is the return type of your script, it is the type of the new value that will be used for the destination tag, and then a checkbox to enable\/disable it for when the protocols are online. To keep the configuration, you need to click save in all configuration dialogs, otherwise the configuration will be lost.<\/p>\n\n\n<p class=\"wp-block-paragraph \" style=\"\"><strong><em>Note: <\/em><\/strong> <em>The script will only run if the Link check box is checked.<\/em><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-remove-a-script-from-a-link\">How to remove a script from a link<\/h2>\n\n\n<p class=\"wp-block-paragraph \" style=\"\">Once you no longer need a script, you will follow the same steps to create one, but now on the script config dialog as it is already configured it will enable the remove button, so if you click on that and save the protocol configuration dialog your script configuration will be deleted, if you cancel the script will continue in the link.<\/p>\n\n\n<figure class=\"wp-block-image size-large\" style=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"973\" height=\"1024\" src=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-80-973x1024.png\" alt=\"\" class=\"wp-image-1144\" srcset=\"https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-80-973x1024.png 973w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-80-285x300.png 285w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-80-768x808.png 768w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-80-11x12.png 11w, https:\/\/protolinker.com\/wp-content\/uploads\/2025\/09\/image-80.png 1190w\" sizes=\"(max-width: 973px) 100vw, 973px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>How to create a script for a link Once you have a link, and you want to manipulate how the receiving tag will get the data you can add a script and make the changes you need to it, like making a unit conversion or transforming a binary number into a real value, for that &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[17],"doc_tag":[],"class_list":["post-793","docs","type-docs","status-publish","hentry","doc_category-scripts"],"year_month":"2026-07","word_count":379,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"beraldoigor","author_nicename":"beraldoigor","author_url":"https:\/\/protolinker.com\/en\/author\/beraldoigor\/"},"doc_category_info":[{"term_name":"Scripts","term_url":"https:\/\/protolinker.com\/en\/docs-category\/scripts\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/docs\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/comments?post=793"}],"version-history":[{"count":0,"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/docs\/793\/revisions"}],"wp:attachment":[{"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/media?parent=793"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/doc_category?post=793"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/protolinker.com\/en\/wp-json\/wp\/v2\/doc_tag?post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}