Jump to content

Reference to file - similar as in termnial with "*" at the end


Recommended Posts

Hi

 

I don't know the right expressions for this, so it's hard for me to search for a solution.

 

Example:

In terminal, if I want to execute a file named 111-222-333.py, I could simply type 111* to execute it, if it's the only file with "111" in the beginning.

 

I would like to use the same in a workflow in Alfred for the "Open File" command.

 

What would be the equivalent to open for example a file called 111-222-333.pdf simply with something like 111* ?

 

Thanks a lot for your help,

 

Chris

Link to comment

Could you expand on how you’re looking for the workflow to work? As in, explaining the exact steps you’d perform and what should happen. If you search for 111 alone, even without the asterisk, the file should be found anyway. And by then it makes sense to have the Open File use the full correct path instead of trying to assume.

Link to comment

Hi

 

I have a 2 items in the workflow.

 

Input: Keyword: "file1"

Action: Open File: "Path to file1"

 

So I do "apple-space" type "filename" and it opens.

 

file1 will be called something like "Projectname-projectgroup-subgroup-date-revnumber.pdf"

 

The Revision of this file changes constantly but old revisions are moved into an archive and only the most recent file is placed inside the folder.

 

So I would like to simply "cut" the path to the filename like this, or what is possible:

 

//folder/subfolder/Projectname-projectgroup-subgroup*

 

This would then always open the latest PDF in this folder, no requirement to rename it for date-revision

 

I hope that explains it better

Link to comment
1 minute ago, Alfred-Chris said:

I hope that explains it better

 

It does, now the purpose is clearer. As a general tip, always aim to ask for the original goal (opening the most recent file in a folder) instead of a specific step of it (opening a file by using a *). This is called an XY problem and it matters because fixing the original question would be both harder and less efficient than the proper solution to the real problem: Use the Files and Folders → Get Most Recently Added Path Automation Task to grab the file and pass it to the Open File.

 

If something needs adjusting in the solution, please do say so and we’ll work it out.

Link to comment

Thanks for all the explanations and teaching me.

 

Unfortunately this is not helping my workflow though and it's also not what I tried to achieve and asked for.

 

There are about 80 files inside this folder, constantly being maintained.

I can unfortunately not just open the "most recent file" to get the one I want.

 

Edit: Of these 8 files I have a direct link as described above to 8 of them. If I wouldn't need to constantly renew the link that would have helped me. I can't change the way how the filing is done. It's not in my hands.

 

I guess if you wouldn't know how it works (judging from your status 😉 ), then probably Alfred can't do this specific thing I hoped for.

Edited by Alfred-Chris
More info
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...