action:Get_File_Attribute
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| action:Get_File_Attribute [2015/07/03 03:27] – created mirazjordan | action:Get_File_Attribute [2023/09/18 08:15] (current) – [File attributes available] peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | The Get File Attribute action | + | ====== Get File Attribute Action ====== |
| + | |||
| + | The //Get File Attribute// action | ||
| + | |||
| + | ===== How To Use ===== | ||
| Click the File Chooser button to the right of the action 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). | Click the File Chooser button to the right of the action 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). | ||
| Line 5: | Line 9: | ||
| The result of the action is displayed at the bottom of the action. | The result of the action is displayed at the bottom of the action. | ||
| - | File attributes available: | + | ===== File attributes available |
| + | |||
| + | {{page> | ||
| + | |||
| + | ===== Addition File Attributes ===== | ||
| + | |||
| + | There are several more attributes available using the [[action: | ||
| + | |||
| + | * Delete the the path extension. | ||
| + | * Expand Path to full page, replacing tilde (~) in the path. | ||
| + | * Resolve symlinks, or standardize the path. | ||
| + | |||
| + | |||
| + | ===== Using Alias and SymLink Files ===== | ||
| + | |||
| + | If you select an Alias or SymLink file using the _File Chooser_ it will return the _target_ rather than the actual path. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | If you want to determine if the Finder Item is an Alias or SymLink, you can use this AppleScript, | ||
| + | |||
| + | ```applescript | ||
| + | tell application " | ||
| + | set theSel to the selection | ||
| + | set theItem to item 1 of theSel | ||
| + | set itemKindStr to (kind of theItem) as text | ||
| + | |||
| + | if (itemKindStr ≠ " | ||
| + | set itemFileType to (file type of theItem) as text | ||
| + | else | ||
| + | set itemFileType to " | ||
| + | end if | ||
| + | |||
| + | if (itemKindStr = " | ||
| + | if (itemFileType = " | ||
| + | set itemKindStr to "Link: SymLink" | ||
| + | else | ||
| + | set itemKindStr to "Link: Alias" | ||
| + | end if | ||
| + | end if | ||
| + | |||
| + | end tell | ||
| + | |||
| + | return itemKindStr | ||
| + | -->Link: Alias | ||
| + | -->Link: SymLink | ||
| + | --> | ||
| + | |||
| + | ``` | ||
| + | |||
| + | ===== See Also ===== | ||
| + | |||
| + | ==== Actions ==== | ||
| + | |||
| + | * [[Set File Attribute]] | ||
| + | * [[Filter]] | ||
| + | * [[: | ||
| + | |||
| + | === Conditions === | ||
| + | |||
| + | * [[condition: | ||
| + | * [[condition: | ||
| + | * [[: | ||
| + | |||
| + | ==== Forum ==== | ||
| - | *file type (r/o). | + | - [[https://forum.keyboardmaestro.com/t/getting-url-of-most-recently-added-file-to-folder/2902/3|Getting url of most recently added file to folder]] |
| - | *file size (r/o). | + | |
| - | *creation date. | + | |
| - | *modification date. | + | |
| - | *added date. | + | |
| - | *last used date. | + | |
| - | *downloaded date. | + | |
| - | *where from. | + | |
| - | *owner name (r/o). | + | |
| - | *owner id (r/o). | + | |
| - | *group name. | + | |
| - | *group id. | + | |
| - | *POSIX permissions. | + | |
| - | *extension hidden. | + | |
| - | *invisible. | + | |
| - | *HFS creator code. | + | |
| - | *HFS type code. | + | |
| - | *content type. | + | |
| - | *content kind. | + | |
| - | *tags (set, add, remove or toggle). | + | |
| - | *comment. | + | |
| - | *parent path (r/o). | + | |
| - | *file name (r/o). | + | |
| - | *base name (r/o). | + | |
| - | *extension (r/o). | + | |
| + | - [[https:// | ||
action/Get_File_Attribute.1435894048.txt.gz · Last modified: by mirazjordan
