Bookmarks to open local files on macos with swiftui? - macos

How can I bookmark references to local files in my Mac app (written in Swiftui)? I want the user to be able to choose files (these are text or spreadsheet files) using NSOpenPanel, store the resulting URLs and display them so when you click on the description, the corresponding app will open them.
The process is very easy with weblinks but I have not had any luck using local path URLs.

Related

Google Drive: Download of shared folders for signed out users

I want to share Google Drive folders by sharing their folder link to people. An example folder is https://drive.google.com/drive/folders/17Jh-Va8M1XQSJyrugV-iAtOTIwYePbvV
The folder contains original files as well as the new Google drive "shortcuts" (btw: I'm the owner of the original files where those shortcuts link to).
I want that also people which aren't signed in to a Google account are able to download the whole folder. I noticed 2 new problems which occured since Google introduced the new shortcut system this year:
signed out users aren't able to download all files of a folder with one click. There's no "Download All" button any more. It's just possible to download single files.
Signed out useres aren't able to download Shortcut-files. Just original files by clicking onto "Download"
Do you have an idea how to fix problems 1) and 2) for signed out users?
As a workaround for 1):
Create a folder inside of the main shared folder and mive all files to the nested folder.
When the user opens the main folder he can download with one click the nested folder and all contained files:
As for 2)
The shortcuts are no files but just links to files - if the original files are not shared with the permission Anyone on the internet with this link can view - then users who are not signed in cannot access those files.
You need to share the original files accordingly, in this case the user will be able to open the shortcut and then go on File->Download.
Arguably it makes more sense to directly move the original file into the shared folder instead of using shortcuts.

Folder to an application

I apologize upfront for butchering the verbiage. Here is what I am trying to figure out.
I work with projects that currently use windows folders to store project files (500-1000) per project. The current interaction with a project is clicking through folders and opening individual files. There are also a lot of macros already in use in the various excel workbooks.
I would like to create a desktop "application" that stores files but also runs script, basically cleaning up the project interface and turning the project folder structure into a single desktop "object".
The "application" would open an interface (such as a vba user form) when double-clicked.
The "application" would contain the project files (excel, word, pdf, etc.)
The interface would be used to navigate through the contained files and update the various files in the "application" with user input data.
The "application" could be "cracked open" to see the files inside in windows explorer (similar to how .exe can be changed to .zip)
I've not been able to find anything that matches what I'm looking for so any that points me in the right direction would be greatly appreciated.

Mac OS: Smart Folders and Subfolders

Mac OS has the built-in smart folder feature that can narrow down files in a specific location based on a given set of properties (e.g. file extension, size, creation date, etc.).
I am trying to declutter my desktop by file type, and want to select all images on my desktop to place in a separate folder. The thing is, the smart folder seems to select all image files that are nested within the desktop's subfolders. Is there anyway to select files excluding the ones located in subfolders?
Thanks!
~ Joseph
Open a standard Finder window and navigate to your Desktop folder. Set the window to list view and sort by clicking on the Kind column header. Now all your images will be grouped together by image type. Select each group by clicking on the first file in the group and shift clicking on the last, then drag into your destination folder.
HTH

Where does Chrome store userscripts.user.js files on a mac?

i want to know where chrome stores the userscripts that are installed.
i couldn't find any answer elsewhere.
i'm on a mac.
Finding the extension ID
If you have many user scripts, we'll need to find the extension ID of your user script for the next step. Go to chrome://extensions/ in your address bar, or navigate to the wrench icon, then Tools -> Extensions.
Under each extension, you'll see an entry like ID: inoibihbncpenbmllpjoonoaadechdng. This is the extension ID. Find your script, and observe the ID.
These user scripts are usually stored in:
~/Library/Application Support/Google/Chrome/Default/Extensions
If this path makes sense, you can skip the next section. Otherwise, follow along below for more detailed instructions.
Finding your Extensions folder
Go to your user folder. You can do this by opening Finder, and going to Go -> Home. Then we want to navigate to Library/Application Support/Google/Chrome/
If you're not using multiple Chrome profiles, at this point you should be able to just go to Default/Extensions/
Extension layout
Each extension will be in a folder, named after their extension ID. Inside this, we'll have a version number, then any metadata files. In the latest version of Chrome, userscripts will have at minimum a script.js file and manifest.json. You're looking for script.js, which contains the actual Javascript.

How to import just a Firefox bookmark folder?

I have Firefox running on two computers. Each one with your bookmarks.
I'd like to import just a folder of computer 1 Firefox bookmarks to computer 2 Firefox bookmarks.
I don't want to import all the bookmarks, just a folder.
I thought of doing that directly in the bookmarks file: bookmarks.html.
But how do I do it?
Solved:
I exported the bookmarks as an HTML file, then I opened it in an HTML editor. Then it is not so hard to spot the folders and bookmarks inside it. I copied what I wanted.
Open the other Firefox, export bookmarks, open it in an HTML editor and paste the code. Save.
From inside Firefox, import the changed bookmarks.html and voila!!
Backup your bookmarks as a JSON file.
Delete the bookmarks you do not want.
Export the ones you do want as an HTML file
Restore your bookmarks with the JSON file
Install Firefox add-on OneTab
Send tabs to OneTab
Click Share as webpage
(or select and copy the text)
Save and move that page
https://addons.mozilla.org/en-US/firefox/addon/onetab/?src=search
"Send tabs to the right to OneTab" is probably what you're after.
I was similarly surprised how hard this was without an add-on but this is an easy solution once I thought of it.
You have to get used to how OneTab works, and maybe tweak its settings for how you work, and I still do a lot of save all tabs, but OneTab has become a very useful on-the-fly part of my tab/ boookmarking process.
Here's a not too difficult solution.
I've had a similar problem with a folder disappearing from my very heavily populated Bookmarks toolbar. I probably accidentally did something to delete it. Fortunately, the folder still existed on another computer.
I tried exporting to html (10,000 lines) and json (1 line 78,000 characters wide), so I didn't fancy editing either of those.
Here's what I did.
On the computer with the bookmarks still remaining, Export the bookmarks to html (Bookmarks/Show All Bookmarks/Import and Backup/Export Bookmarks to HTML).
Open the containing folder from the download dialog box. Open this html file in Firefox in the destination profile.
Use FF search to find the folder you want and select the title of the folder to the end of the folder contents.
Here's the good stuff. I don't know if this was in Firefox when this problem was first raised. Right click and select "View Selection Source".
You'll get a popup window with just the source you need. Save it straight from the window as a .html file. (Web page only) Copy the path from the saveas box address bar.
Open the bookmarks library ShiftCtrl_B, Import the html file. (Paste the path into the address bar.)
Move the folder from the bottom of the Bookmarks Menu folder to where you want it. Done
Open Firefox
Select a bookmark folder that you want to export
Select Copy
Open a product that permits to "paste as HTML", it will insert the "titles" and
the links in a structure HTML, with correct TAGS (HREF, DD, DT, ...):
PsPad
AceHTML
Create an empty file [NomeFile].HTML
Paste as HTML (you must obtain an HTML structure)
Execute in this order:
Substitute: "DL>"
With: "DL><p>"
Delete: "<DD>"
Delete: "</DD>"
Delete empty rows
Substitute: "<DT>"
With: "<DT><H3>"
Substitute: "<A HREF"
With: "<DT><A HREF"
Save the file
In Firefox
Import and Backup
Import bookmark as HTML, select the file created
Open all the imported links to obtain the favicons
This procedure worked exporting from FireFox 71 and importing in Firefox 83
Drag and drop the folder to any Firefox text-ready field (I'm used to use Yahoo notepad). You will be provided with a clean text list of all the URLs contained in the folder.
Copy/paste on a software able to generate a mail/PDF and all links will be active.
Word/LibreOffice allow the activation of links when any space related figure (spacebar, enter, tab, etc.) is manually added. Pretty boring, but it is an easy task to generate an HTML file ready for import back to Firefox.
Just a wild guess... I think there are specialistic text editors around that have some function able to perform the conversion with much less hassle :)...
For firefox 57 and later, use the addon tabzen.
Install the addon
click tabzen icon
choose settings icon in upper right corner to get popup
on the popup use the icon in the upper right to put the popup in a tab
use import on the root directory of a file you created from the "show all bookmarks" window using export. This had created an html file of all bookmarks in a profile. Now with all this folder structure in tabzen, you can go to a folder and export just that folder to an html file.
You can use that html file, to import where you want it in your own browser by using the "show all bookmarks" window, go to the folder where you want to import to, and import the html file created by tabzen.
By default tabzen puts html files in the download directory.
BookmarksHome cuts out steps 1 and 2 from JT Ripper's answer above. Click the icon opens the bookmarks in a web page in the source profile. Start from step 3 - now only 4 steps. (But it spreads subfolders around you need to search for them!)
I've tried many answers on here, but none of them achieved my goal:
To import all Firefox bookmarks without messing up the folder structure
Here's what worked for me:
open the Website about:profiles
in Root Directory click on Open Directory (if there are multiple profiles, click on the one without the button Lauch profile in new browser)
copy (not move!) all the files onto a USB or smth similiar
3.1 (connect the USB to the 2nd PC)
repeat step 1 and 2 on the 2nd PC
go to the parent directory (i.e. one directory up)
create a new folder, the name should end with ., e.g. "lsri5trz.default"
copy (or move) all the files from the USB into the created folder
go back to firefox in about:profiles
click on Create a new profile > then Next
type in the '2nd name' of the folder (in this case "default")
click on Choose Folder...
select the created folder
under the profile, click on "Lauch profile in new browser"
The disadvantage is that copying the files can take up to 10mins each time, because you are not just copying the bookmarks, but also all the settings, configuration files, themes, addons, history... This is why this is not the optimal way to just import the bookmarks with the right folder structure
One way is
Click on Bookmarks > Organize Bookmarks > Import and Backup > backup
& save that file, transfer it to your new computer and import it into Firefox.
Another tedious(may be) way Organize Bookmarks > Export Bookmark. You can then email the file, save it to a utility like
dropbox, put it on a USB drive or whatever else you may have available
to transfer it to your other computer. Then you can import it into the
browser on your other computer.
Look here : Export Bookmarks in Mozilla Firefox

Resources