File Input & Output Reference

This page describes built-in Touch Portal File Input & Output actions, events and states. For other automation options, see the Touch Portal Capability Model.

File Input & Output Actions

Write To File

The Action 'Write To File' as visible in Touch Portal.

Action settings

File
The file to write to
Text
The contents written to the given file
This action allows you to write content to a file. The file is cleared of contents before writing.
Note: This will write the file using UTF-8 encoding.
Action
Icon showing the Touch Portal category this item belongs to.

2.2

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Append To File

The Action 'Append To File' as visible in Touch Portal.

Action settings

File
The file you want to append to
Text
The text you want to append
This action allows you to append text to the given file
Note: This expects the file to be in UTF-8 encoding and will be saved as such as well after appending.
Action
Icon showing the Touch Portal category this item belongs to.

2.2

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Create File

The Action 'Create File' as visible in Touch Portal.

Action settings

File
The file you want to create.
This action allows you to create a file. If the specified file already exists on disc then this action will fail silently.
Action
Icon showing the Touch Portal category this item belongs to.

3.0.11

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Delete File

The Action 'Delete File' as visible in Touch Portal.

Action settings

File
The file you want to delete.
This action allows you to delete a file. If the file does not exist this action will fail silently.
Note: The action expects that Touch Portal has the rights to delete files from the disc. If the OS prevents this or the file is locked, this action will fail. Cloud synced file may not be deleted properly by this action, read the manual of the cloud syncing software to see the requirements to correctly delete the given file.
Action
Icon showing the Touch Portal category this item belongs to.

2.2

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Copy File

The Action 'Copy File' as visible in Touch Portal.

Action settings

Source
Source file.
Destination
Destination folder or destination file path.
Overwrite
Overwrite if existing or not
Copy a file to another location. Destination can be a folder or a file path (rename). Optional overwrite.
Action
Icon showing the Touch Portal category this item belongs to.

4.5

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Move File To Folder

The Action 'Move File To Folder' as visible in Touch Portal.

Action settings

File
Source file to move.
Folder
Destination folder to move the file in.
Move a file to a folder. The destination must be a folder path. The target file must not already exist.
Action
Icon showing the Touch Portal category this item belongs to.

4.5

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Rename File

The Action 'Rename File' as visible in Touch Portal.

Action settings

File
Source file.
String
New name (must not exist).
Rename a file. The target needs to be the new filename including the extension.
Action
Icon showing the Touch Portal category this item belongs to.

4.5

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Insert / Replace Line In File

The Action 'Insert / Replace Line In File' as visible in Touch Portal.

Action settings

Action
Insert of replace.
File
The file you want to use.
Line
The line number you want to replace or insert at.
Text
The text to insert or replace at the given line number.
Allows you to insert or replace a line in a file.
Action
Icon showing the Touch Portal category this item belongs to.

4.3

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

File To Value

The Action 'File To Value' as visible in Touch Portal.

Action settings

File
The file you want the contents of
Value
The Value you want to store into
This action allows you to store the contents of a file into a Value. If the file does not exist nothing will happen. If the file cannot be read, nothing will happen.
Action
Icon showing the Touch Portal category this item belongs to.

2.2

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Get Line Count From File

The Action 'Get Line Count From File' as visible in Touch Portal.

Action settings

File
The file to get the line count from.
Value
The Value to store the line count into.
This action allows you to the line count from a text file. If the file does not exist nothing will happen. If for some reason the file cannot be read nothing will happen.
Note: This expects the file to be in UTF-8 encoding.
Action
Icon showing the Touch Portal category this item belongs to.

3.0.11

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Get Line From File

The Action 'Get Line From File' as visible in Touch Portal.

Action settings

Line Number
The number of the line in the file.
File
The text file from which the line is retrieved.
Value
The Value into which the retrieved line is set.
This action allows you to get a specified line from a text File. If the file does not exist nothing happens. If the given line number is not a number nothing happens. If the file has less lines than the line number given, the last line is used.
Note: This expects the file to be in UTF-8 encoding.
Action
Icon showing the Touch Portal category this item belongs to.

3.0.11

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Remove Lines From File

The Action 'Remove Lines From File' as visible in Touch Portal.

Action settings

Line Start
The start line number of the line range you want to remove
Line End
The end line number of the line range you want to remove
File
The file from which you want to remove the lines.
This action allows you to remove lines from a text file.
Note: This action expects the file to be in UTF-8 encoding and will also save the file back with UTF-8 encoding.
Action
Icon showing the Touch Portal category this item belongs to.

4.0

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Url Result To File

The Action 'Url Result To File' as visible in Touch Portal.

Action settings

Url
The url.
File
The file to store the endpoints content in.
This action allows you to get the result of a endpoint (url) and store it into a file
Note: This uses UTF-8 encoding for the file.
Note: The contents can be altered based on newlines and OS specifics
Action
Icon showing the Touch Portal category this item belongs to.

2.3

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Iterate Folder Contents

The Action 'Iterate Folder Contents' as visible in Touch Portal.

Action settings

Iterate Option
Whether to iterate sub-folders as well or not.
Folder
Folder to iterate.
This action allows you to iterate through all the files within a specific folder..
Action
Icon showing the Touch Portal category this item belongs to.

4.5

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Copy Folder

The Action 'Copy Folder' as visible in Touch Portal.

Action settings

Source Folder
The folder you want to copy
Destination Folder
The destination to copy the folder to
Copy a folder to another location. Destination folder must not already exist.
Action
Icon showing the Touch Portal category this item belongs to.

4.5

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

Rename Folder

The Action 'Rename Folder' as visible in Touch Portal.

Action settings

Folder
Source folder.
String
New name or target folder path (must not exist).
Rename a folder. The target can be a new name (same parent) or a full destination folder path (move+rename).
Action
Icon showing the Touch Portal category this item belongs to.

4.5

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Action is supported on Windows.
Green macOS Logo indicating this Action is supported on macOS.
Green Linux Logo indicating this Action is supported on Linux.

File Input & Output Events

When A File Changes

The Event 'When A File Changes' as visible in Touch Portal.

Event settings

File
The file set up to listen for changes.
This events can be set up to listen when the contents of a file changed.
Note: Wildcards and codes cannot be used in the file field because file listeners are not dynamic and are set when loaded and are directly connected to the specified file.
Event
Icon showing the Touch Portal category this item belongs to.

2.2

Available since
Touch Portal Logo used to accompany the version number this item was available from.
Green Windows Logo indicating this Event is supported on Windows.
Green macOS Logo indicating this Event is supported on macOS.
Green Linux Logo indicating this Event is supported on Linux.