User Tools

Site Tools


action:Write_to_a_File

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
action:Write_to_a_File [2018/02/12 21:58]
peternlewis
action:Write_to_a_File [2023/05/15 00:22] (current)
peternlewis [Warnings]
Line 1: Line 1:
-The Write to a File and [[action:​Append Text to a File|Append Text to a File]] actions allow you to write a variety of things ​to a file on disk.+====== Write To File Action ====== 
 + 
 + 
 +The Write to a File and [[action:​Append Text to a File|Append Text to a File]] actions allow you to write data from a variety of sources ​to a file on disk. 
  
-**Warning: Ensure you specify a file path, not a path to a directory - this action uses an Apple API that can overwrite directories,​ destroying them completely.** 
  
 Write or append the current system clipboard, a named clipboard, a variable, some text or some styled text (you can write but cannot append styled text). Write or append the current system clipboard, a named clipboard, a variable, some text or some styled text (you can write but cannot append styled text).
 +
 +===== Warnings =====
 +
 +** 1. Will Overwrite Existing File**
 +
 +While the [[action:​Copy_a_File|Copy a File]] action will NOT overwrite an existing file, and will cause the Macro to abort/​cancel IF the "​Failure Aborts Macro" option is checked, this //Write to a File// action //will// overwrite ​ an existing file without warning or failure. ​ The "​Failure Aborts Macro" option has no effect on this.
 +
 +**2. Inadvertent Destruction of Folder (pre v8.1)**
 +
 +Ensure you specify a file path, not a path to a directory - this action uses an Apple API that can overwrite directories,​ destroying them completely (pre-v8.1).** ​ As of v8.1+, this action will trash (if possible) (in to the trash folder) any existing file or directory you are about to overwrite.
 +
 +===== How To Use =====
  
 Select the file to write to by specifying its path. Click the File Chooser button on the right to select an existing file on disk. Option-click on the File Chooser button to show the currently selected file in the Finder (assuming it exists already). Select the file to write to by specifying its path. Click the File Chooser button on the right to select an existing file on disk. Option-click on the File Chooser button to show the currently selected file in the Finder (assuming it exists already).
action/Write_to_a_File.1518490706.txt.gz · Last modified: 2018/02/12 21:58 by peternlewis