mdfind

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CODING/DEVELOP
Introduced first in SolidGeometry 5.3, Creation date: 2023-03-29, Last change: 2025-08-18

spotlight using matlab on mac

Description

using the terminal command mdfind on osx/macOS

See Also: , spotlightsearch

Example Illustration

 missing image of mdfind()

Syntax

b=mdfind([])

Output Parameter

b: result of spotlight as cell list

Examples


mdfind aston martin coloured .stl




Copyright 2023-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This MATLAB function, mdfind, is designed to perform a file search on macOS using the Spotlight search feature via the terminal command mdfind. The function is part of the SolidGeometry library and was introduced in version 5.3.

Input Parameters

Output

Algorithm Steps

  1. Initialize a string txt with the value 'mdfind'.
  2. Iterate over each input argument in varargin and append it to txt with a space separator. This constructs the full command to be executed in the terminal.
  3. Execute the constructed command using the system function, which runs the command in the macOS terminal. The output is captured in b.
  4. Split the output b into separate lines using splitlines.
  5. Filter the lines in b to include only those that contain a forward slash '/', which indicates a file path.
  6. If no output argument is specified (i.e., nargout == 0), convert the file paths in b to hyperlinks using the strhyperlinkmatlab function with the 'open' option.
Algorithm explaination created using ChatGPT on 2025-08-18 22:31. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21