Buchholdt Posted August 23 Share Posted August 23 (edited) Hi all, The problem I'm trying to solve is that I would like a way to copy a direct link to a selected file of folder, whereafter I can insert the link into fx. Apple Notes, and then when clicking the link open thenfile in the desktop app or Finder. This is to help me organise my projects and have a singe Apple Note or Task Manager be the hart of information. And an added benefit for me is that I really prefer working local with desktop apps instead of through the browser, where fx. a shared link from OneDrive would open a file. I have been googeling and reading on the forum here, to find a solution to copy a filename of a selected file on my computer. Sadly I have not been able to find any solutions I can use. I do find some older treats on the topic, but the solutions doesn't work anymore, or at least I can't get them to work. Do any of you know if this is doable, and can lead me in a direction to create a workflow that can help me copy a local file or folder path? Thanks Edited August 23 by Buchholdt Link to comment
Stephen_C Posted August 23 Share Posted August 23 Can you explain in a little more detail exactly what you want to achieve, please? For example, do you want to copy a file and put it in another folder somewhere on your computer or are you trying to do something different? Stephen Link to comment
Buchholdt Posted August 23 Author Share Posted August 23 Hi Stephen, Apologies for not bring clear, I see that especially after you pointed it out. I have updated the original post, thanks again. Link to comment
Stephen_C Posted August 23 Share Posted August 23 Here is a very basic starter for you: The Arg & Vars action is simply this, to assemble the file URL: After that you could do a number of things, of course…copy the {var:fileURL} to the clipboard and paste it into an Apple note, maybe automate the opening of an Apple note (a little tricky!) and automatically paste it… If anything is not clear or you need more help just ask and either I can clarify or someone better qualified can come along with better ideas. 😀 Stephen Link to comment
vitor Posted August 23 Share Posted August 23 You shouldn’t need the Automation Task, as paths from Universal Actions are already expanded. Stephen_C 1 Link to comment
Stephen_C Posted August 23 Share Posted August 23 I was a little misled by watching the debugger—where the tilde was not expanded! Stephen Link to comment
vitor Posted August 23 Share Posted August 23 Huh, it should. Maybe I’m misunderstanding something, may I see the debugger output? Link to comment
Stephen_C Posted August 23 Share Posted August 23 It's OK - I accept you are always right. 😀 I've just checked again and the debugger shows the full path. I've no idea what I previously managed to do which made the debugger show the curtailed path: sorry! However, there is clearly not a problem and all works as you say it should (of course!). Stephen Link to comment
Stephen_C Posted August 23 Share Posted August 23 I was sufficiently interested in this to create a small, simple workflow called Create link to file which I've published on GitHub. It is simple but it does deal with the need to encode the file URL where the path or filename includes a space or spaces. Here is the download link in case the workflow is of any interest. Stephen Buchholdt 1 Link to comment
vitor Posted August 23 Share Posted August 23 Quick tip: you should be able to both simplify it and make it more resilient by going Universal Action → URL Encode Text Automation Task → file://{query}. After all, despite being local file:// has the same rules for encoding. Link to comment
Stephen_C Posted August 23 Share Posted August 23 (edited) I'll take a look at that later but when I used the URL Encode Text Automation Task I found that it encoded the forward slashes in the path too…which I think I did not want (?). At least, the link (in a markdown document) doesn't work when I do that! Stephen Edited August 23 by Stephen_C Clarification of link location Link to comment
Buchholdt Posted August 26 Author Share Posted August 26 Thank you so much for helping out here, and you two look into it😀 I have played around with the downloaded Github file at it works really well, and is a huge win for my workflow in so many ways. Now I look forward to a very productive monday morning. Thanks again Stephen_C 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now