Jump to content

Can Alfred put shortcut links to web pages and links to other folders inside of a folder?


Recommended Posts

Hi all,

I wondered if Alfred can handle the following workflow:

 

I'd like to make a workflow that among other things will create a folder that has a set of specific links in it:

  • A link to a website (you know, how you can drag a weblink from your browser directly onto your desktop--or whatever is the right method for this type of thing).
  • An alias (shortcut) of a folder from somewhere else that I can dump into this folder for quick access to that other folder when and if I need it. As an example, a quick link to my website.
  • A Finder Window pathname that's hyperlinked.

 

Note: I'm on a MacBook Pro running OS Monterrey and the latest Alfred.

 

I image this is probably simple to do and something Alfred can do, but I can't seem to find the right sort of Alfred workflow option to make it work.

Edited by AuthorsAssembler
Link to comment
7 hours ago, AuthorsAssembler said:

I wondered if Alfred can handle


You can do it from Alfred, yes, but it will require a bit of coding. We can help you with that.

 

7 hours ago, AuthorsAssembler said:

among other things


If you’re not comfortable with coding, you’ll have to share every step in as much detail as possible for us to be able to help.

 

7 hours ago, AuthorsAssembler said:

An alias (shortcut) of a folder


For example, the exact source of that directory and where everything is going to be saved.

 

7 hours ago, AuthorsAssembler said:

A Finder Window pathname that's hyperlinked.


I don’t know what that is. Can you describe it another way and/or with images?

 

7 hours ago, AuthorsAssembler said:

and the latest Alfred.


Never say you’re on the latest; always specify the exact version. We don’t know if “latest” means the latest beta or stable or if you think you’re up to date but are mistaken. Furthermore, people who bump into your post in the future won’t know if it applies to them. That’s more relevant for debugging, though, it doesn’t matter as much in this case.

Link to comment

Thank you, vitor. I'll do my very best to explain.

 

I have a folder on my hard drive here:

 

/Volumes/Chronos Access/Chronos Documents/AA and SS Biz/WORK/All Client and Product Files/POSTWORK/POSTWORK NOW - Renders

 

  • Inside it, I'd like to run an Alfred workflow to create a new folder called "New Render Collection."
  • And I'd like it to create a folder inside of that one that houses and is called "Quick Links".
  • In the quick links folder, I'd like to put links to other things, such as a link to an application and a link to a website. (The reason for this is that sometimes I don't want Alfred to open everything at once for a given project. I'd like the ability to just have the links there in case I need to open those things later as the work progresses.

 

Let's ignore the pathname for now. If I can just learn how to create a folder and then create one inside of it and dump a set number of links in there (weblink, shortcut to an application, etc.), that would help a bunch. I can likely then apply what I've learned to further tweaks.

 

Thanks for your assistance. Really appreciate it!

Link to comment

Probably best to teach you to do each individually, so you can connect them later. To create a new folder, make a Run Script Action with default settings and code:


mkdir -p "/full/path"


Use ${1} to insert a previous argument. For example, if you used a Keyword Input and gave it an argument of New Render Collection, then the following code:


mkdir -p "/Volumes/Chronos Access/${1}"


Would create /Volumes/Chronos Access/New Render Collection.


To link to a file or folder, use the same setup and code:


ln -s "/full/original/path" "/full/target/path"


Example:


ln -s "/Applications/Safari.app" "/Volumes/Chronos Access/Safari"

 

${1} also works.


To create a file link a website, use a Write File Output. Save the filename with a .webloc extension, and in the contents:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>URL</key>
    <string>https://www.alfredforum.com</string>
</dict>
</plist>


Note the https://www.alfredforum.com, which you need to change to the desired result. In this case, use {query} or {var:varname} to make it dynamic. The bottom of that window and the linked documentation explain that part.

Link to comment
On 2/1/2022 at 3:08 PM, vitor said:

Probably best to teach you to do each individually, so you can connect them later. To create a new folder, make a Run Script Action with default settings and code:

 

mkdir -p "/full/path"

 


Use ${1} to insert a previous argument. For example, if you used a Keyword Input and gave it an argument of New Render Collection, then the following code:

 

mkdir -p "/Volumes/Chronos Access/${1}"

 


Would create /Volumes/Chronos Access/New Render Collection.


To link to a file or folder, use the same setup and code:

 

ln -s "/full/original/path" "/full/target/path"

 


Example:

 

ln -s "/Applications/Safari.app" "/Volumes/Chronos Access/Safari"

 

 

${1} also works.


To create a file link a website, use a Write File Output. Save the filename with a .webloc extension, and in the contents:

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>URL</key>
    <string>https://www.alfredforum.com</string>
</dict>
</plist>

 


Note the https://www.alfredforum.com, which you need to change to the desired result. In this case, use {query} or {var:varname} to make it dynamic. The bottom of that window and the linked documentation explain that part.

 

Thank you so much! I will work on this and do some testing. Will report back if I get it figured out. ;)


~Cheri

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...