Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Queries the Finder icon for the file or folder with the given path.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
QuickLook Files | 2.3 | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
Path | The path to the file or folder. | "/Applications" | |
Size | The size of the icon picture you'd like to have. Suggested range is from 16 to 512 pixel. | 512 | |
Flags | Available in MBS FileMaker Plugin 13.2 or newer. Various flags. Pass 1 to not frame quicklook previews. Pass 2 to not return an icon, if quicklook is not available. Pass 3 to use both flags. |
0 | Optional |
Container value.
Queries preview on iPhoto app:
MBS( "Icon.GetIconWithQuickLook"; "/Applications/iPhoto.app"; 512 )
Add picture to field:
Set Field [ test::pic ; MBS("Icon.GetIconWithQuickLook"; "/Users/cs/Desktop/solar-system.png"; 512) ]
Make preview via QuickLook:
# try quickLook functions
Set Variable [ $fpath ; Value: GetAsText($input) ]
If [ Position ( $fpath ; "/" ; 1 ; 1 ) > 0 ]
Set Variable [ $path ; Value: MBS( "Path.FileMakerPathToNativePath"; $fpath) ]
If [ Length ( $path ) > 0 ]
Set Variable [ $image ; Value: MBS( "Icon.GetIconWithQuickLook"; $path; 512; 1 ) ]
If [ MBS("IsError") = 0 ]
Set Field [ Get Preview::Preview ; $image ]
Set Field [ Get Preview::Made using ; "QuickLook File" ]
Exit Script [ Text Result: ]
End If
End If
Else If [ Position ( $types ; "FNAM" ; 1 ; 1 ) > 0 ]
# write temp file
Set Variable [ $path ; Value: MBS( "Path.AddPathComponent"; MBS( "Folders.UserTemporary" ); $fpath) ]
Set Variable [ $r ; Value: MBS("Container.WriteFile"; $input; $path) ]
If [ MBS("IsError") = 0 ]
Set Variable [ $image ; Value: MBS( "Icon.GetIconWithQuickLook"; $path; 512; 1 ) ]
If [ MBS("IsError") = 0 ]
Set Field [ Get Preview::Preview ; $image ]
Set Field [ Get Preview::Made using ; "QuickLook Container" ]
Set Variable [ $r ; Value: MBS("Files.Delete"; $path) ]
Exit Script [ Text Result: ]
End If
Set Variable [ $r ; Value: MBS("Files.Delete"; $path) ]
End If
End If
This function checks for a license.
Created 18th August 2014, last changed 15th April 2023