User Tools

Site Tools


action:Get_File_Attribute

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
action:Get_File_Attribute [2019/05/29 11:42]
JMichaelTX [File attributes available]
action:Get_File_Attribute [2019/07/08 04:47]
peternlewis
Line 8: Line 8:
  
 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.
- 
-===== 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. 
- 
-{{:​action:​get-file-attribute-km8.png?​nolink|}} 
- 
-If you want to determine if the Finder Item is an Alias or SymLink, you can use this AppleScript,​ which will return either "Link: Alias" OR "Link: SymLink"​ OR the file kind. 
- 
-```applescript 
-tell application "​Finder"​ 
-  set theSel to the selection 
-  set theItem to item 1 of theSel 
-  set itemKindStr to (kind of theItem) as text 
-  ​ 
-  if (itemKindStr ≠ "​folder"​) then 
-    set itemFileType to (file type of theItem) as text 
-  else 
-    set itemFileType to "​folder"​ 
-  end if 
-  ​ 
-  if (itemKindStr = "​Alias"​) then 
-    if (itemFileType = "​missing value"​) then 
-      set itemKindStr to "Link: SymLink"​ 
-    else 
-      set itemKindStr to "Link: Alias" 
-    end if 
-  end if 
-  ​ 
-end tell 
- 
-return itemKindStr 
--->Link: Alias 
--->Link: SymLink 
--->​BBEdit text document 
- 
-``` 
- 
- 
- 
---- 
  
 ===== File attributes available ===== ===== File attributes available =====
Line 77: Line 36:
   *base name (r/o).   *base name (r/o).
   *extension (r/o).   *extension (r/o).
 +  *display name (r/o, v9.0+).
  
 ===== Addition File Attributes ===== ===== Addition File Attributes =====
Line 88: Line 48:
  
  
-===== See Also =====+===== 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. 
 + 
 +{{:​action:​get-file-attribute-km8.png?​nolink|}} 
 + 
 +If you want to determine if the Finder Item is an Alias or SymLink, you can use this AppleScript,​ which will return either "Link: Alias" OR "Link: SymLink"​ OR the file kind. 
 + 
 +```applescript 
 +tell application "​Finder"​ 
 +  set theSel to the selection 
 +  set theItem to item 1 of theSel 
 +  set itemKindStr to (kind of theItem) as text 
 +   
 +  if (itemKindStr ≠ "​folder"​) then 
 +    set itemFileType to (file type of theItem) as text 
 +  else 
 +    set itemFileType to "​folder"​ 
 +  end if 
 +   
 +  if (itemKindStr = "​Alias"​) then 
 +    if (itemFileType = "​missing value"​) then 
 +      set itemKindStr to "Link: SymLink"​ 
 +    else 
 +      set itemKindStr to "Link: Alias"​ 
 +    end if 
 +  end if 
 +   
 +end tell 
 + 
 +return itemKindStr 
 +-->Link: Alias 
 +-->Link: SymLink 
 +-->​BBEdit text document
  
-----+```
  
-=== Actions ===+===== See Also ===== 
 + 
 +==== Actions ​====
  
 * [[action:​Set File Attribute|Set File Attribute]] * [[action:​Set File Attribute|Set File Attribute]]
 * [[action:​Filter|Filter]] * [[action:​Filter|Filter]]
 * [[:​Actions|See all Actions]] * [[:​Actions|See all Actions]]
- 
----- 
  
 ==== Forum ==== ==== Forum ====
action/Get_File_Attribute.txt · Last modified: 2019/07/08 04:56 by peternlewis