{"id":19535609,"url":"https://github.com/miyako/4d-plugin-workspace-services","last_synced_at":"2025-04-26T14:35:55.506Z","repository":{"id":3865827,"uuid":"4951296","full_name":"miyako/4d-plugin-workspace-services","owner":"miyako","description":"Collection of functions from the NSFileManager and NSWorkSpace classes on OS X 10.5 and later.","archived":false,"fork":false,"pushed_at":"2024-04-30T04:05:38.000Z","size":5041,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T14:11:21.487Z","etag":null,"topics":["4d-plugin"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miyako.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-07-09T00:28:13.000Z","updated_at":"2024-08-27T04:43:22.000Z","dependencies_parsed_at":"2023-07-07T00:31:51.269Z","dependency_job_id":null,"html_url":"https://github.com/miyako/4d-plugin-workspace-services","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-workspace-services","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-workspace-services/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-workspace-services/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-workspace-services/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miyako","download_url":"https://codeload.github.com/miyako/4d-plugin-workspace-services/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251001455,"owners_count":21520949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["4d-plugin"],"created_at":"2024-11-11T02:19:19.289Z","updated_at":"2025-04-26T14:35:54.806Z","avatar_url":"https://github.com/miyako.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![version](https://img.shields.io/badge/version-19%2B-5682DF)\n![platform](https://img.shields.io/static/v1?label=platform\u0026message=mac-intel%20|%20mac-arm\u0026color=blue)\n[![license](https://img.shields.io/github/license/miyako/4d-plugin-workspace-services)](LICENSE)\n![downloads](https://img.shields.io/github/downloads/miyako/4d-plugin-workspace-services/total)\n\n4d-plugin-workspace-services\n============================\n\nCollection of OS X native file manager commands.\n\n## Syntax\n\n```4d\nresult:=FINDER Perform operation (srcPath;dstPath;objects;operation)\n```\n\nParameter|Type|Description\n------------|------------|----\nsrcPath|TEXT|\ndstPath|TEXT|\nobjects|ARRAY TEXT|ames of the files and directories to be manipulated\noperation|LONGINT|see constants\nsuccess|LONGINT|\n\n[performFileOperation:source:destination:files:tag:](https://developer.apple.com/documentation/appkit/nsworkspace/1524886-performfileoperation?language=objc)\n\n* Finder Operations\n\n```c\nOperation Move 0\nOperation Copy 1\nOperation Link 2\nOperation Compress 3\nOperation Decompress 4\nOperation Encrypt 5\nOperation Decrypt 6\nOperation Destroy 7\nOperation Recycle 8\nOperation Duplicate 9\n```\n\n```4d\nicon:=FINDER Get icon for file type (typeId;fileType)\n```\n\nParameter|Type|Description\n------------|------------|----\ntypeId|TEXT|\nfileType|LONGINT|see constants\n\n* File Types\n\n```c\nFile OSType 0\nFile UTI 1\nFile Extension 2\nFile MIME Type 3\n```\n\n```4d\nFULL SCREEN BEGIN (width;height;flags)\nFULL SCREEN END\n```\n\n**deprecated** [QuickTime](https://developer.apple.com/library/content/documentation/QuickTime/QT6_3/Chap1/QT6WhatsNew.html) 32-bit only\n\n```4d\nresult:=APPLICATION Get path (appId;pathStyle)\n```\n\nParameter|Type|Description\n------------|------------|----\nappId|TEXT|\npathStyle|LONGINT|see constants\nresult|TEXT|\n\n* Path Styles\n\n```\nPath Style HFS 0\nPath Style POSIX 1\nPath Style URL 2\n```\n\nreturns the absolute or full path for the specified application, in the requested format\n\n```4d\nsuccess:=APPLICATION Launch (appId;options)\n```\n\nParameter|Type|Description\n------------|------------|----\nappId|TEXT|\noptions|LONGINT|see constants\nsuccess|LONGINT|\n\n[launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:](https://developer.apple.com/documentation/appkit/nsworkspace/1533335-launchappwithbundleidentifier?language=objc)\n\nsuccess:=APPLICATION Launch paths (appId;options;paths)\n\nParameter|Type|Description\n------------|------------|----\nappId|TEXT|\noptions|LONGINT|see constants\npaths|ARRAY TEXT|paths (internally converted from HFS to URL)\nsuccess|LONGINT|\n\n[openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:](https://developer.apple.com/documentation/appkit/nsworkspace/1535886-openurls?language=objc)\n\n* Launch Options\n\n```\nLaunch And Print 2\nLaunch Without Adding Recents 256\nLaunch Without Activation 512\nLaunch Asyncronous 65536\nLaunch New Instance 524288\nLaunch And Hide 1048576\nLaunch And Hide Others 2097152\n```\n\n```4d\nlabel:=DOCK Get badge label\nDOCK SET BADGE LABEL (label)\n```\n\nParameter|Type|Description\n------------|------------|----\nlabel|TEXT|\n\n```4d\nicon:=DOCK Get icon\nDOCK SET ICON (icon)\n```\n\nParameter|Type|Description\n------------|------------|----\nicon|PICTURE|\n\nsetting an empty picture resets the dock icon\n\n```4d\nicon:=FILE Get icon (path)\nFILE SET ICON (path;icon)\n```\n\nParameter|Type|Description\n------------|------------|----\npath|TEXT|\nicon|PICTURE|\n\n```4d\nresult:=FILE Get application name (path)\n```\n\nParameter|Type|Description\n------------|------------|----\npath|TEXT|\nappName|TEXT|\n\n[getInfoForFile:application:type:](https://developer.apple.com/documentation/appkit/nsworkspace/1535102-getinfoforfile?language=objc)\n\n```4d\nname:=FILE Get localized name (path)\n```\n\nParameter|Type|Description\n------------|------------|----\npath|TEXT|\nname|TEXT|\n\n[displayNameAtPath:](https://developer.apple.com/documentation/foundation/nsfilemanager/1409751-displaynameatpath)\n\n```4d\nsuccess:=FILE Open with application (path;appId;deactivate)\n```\n\nParameter|Type|Description\n------------|------------|----\npath|TEXT|\nappId|TEXT|\ndeactivate|LONGINT|\nsuccess|LONGINT|\n\n[openFile:withApplication:andDeactivate:](https://developer.apple.com/documentation/appkit/nsworkspace/1530182-openfile?language=objc)\n\n```4d\nFOLDER GET CONTENTS (path;paths;pathType)\nFOLDER GET SUBPATHS (path;paths;pathType)\n```\n\nParameter|Type|Description\n------------|------------|----\npath|TEXT|\npaths|ARRAY TEXT|\npathType|LONGINT|see constants\n\nconsider native 4D command ``DOCUMENT LIST``\n\n## Examples\n\n```4d\n$icon:=FINDER Get icon for file type (\"public.jpeg\";File Extension)\nSET PICTURE TO PASTEBOARD($icon)\n\n$icon:=FINDER Get icon for file type (\"4db\";File Extension)\nSET PICTURE TO PASTEBOARD($icon)\n\n$icon:=FINDER Get icon for file type (\"text/plain\";File MIME Type)\nSET PICTURE TO PASTEBOARD($icon)\n\n$icon:=FINDER Get icon for file type (\"trsh\";File OSType)\nSET PICTURE TO PASTEBOARD($icon)\n\n$icon:=FILE Get icon (Structure file)\nSET PICTURE TO PASTEBOARD($icon)\n\nC_BLOB($data)\n$filePath:=System folder(Desktop)+Generate UUID\nBLOB TO DOCUMENT($filePath;$data)\nFILE SET ICON ($filePath;$icon)\n```\n\n```4d\nFOLDER GET CONTENTS (Get 4D folder(Database folder);$pathHFS;Path Style HFS)\nFOLDER GET CONTENTS (Get 4D folder(Database folder);$pathPOS;Path Style POSIX)\nFOLDER GET CONTENTS (Get 4D folder(Database folder);$pathURL;Path Style URL)\n```\n\n```4d\n$filePath1:=System folder(Desktop)+Generate UUID+\".txt\"\n$filePath2:=System folder(Desktop)+Generate UUID+\".txt\"\n\nC_BLOB($data)\nBLOB TO DOCUMENT($filePath1;$data)\nBLOB TO DOCUMENT($filePath2;$data)\n\n$appName:=FILE Get application name ($filePath)\n$appName:=\"com.apple.TextEdit\"\n$appName:=\"TextEdit.app\"\n$appName:=\"TextEdit\"\n\nARRAY TEXT($path;0)\nAPPEND TO ARRAY($path;$filePath1)\nAPPEND TO ARRAY($path;$filePath2)\n\nAPPLICATION Launch paths ($appName;Launch Without Activation | Launch And Print;$path)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-workspace-services","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyako%2F4d-plugin-workspace-services","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-workspace-services/lists"}