Jump to content

Make a file invisible


nirsh

Recommended Posts

These commands are to hide/unhide files, and not to show hidden files:

 

chflags hidden [PATH TO FILE/DRAG FILE HERE]

 

 

chflags nohidden [PATH TO FILE/DRAG FILE HERE]

 

In fact it is quite simple to hide a file, but for me personally it's not comfortable to enter each time the terminal and I would prefer an alfred workflow.
Edited by nirsh
Link to comment
Share on other sites

These commands are to hide/unhide files, and not to show hidden files:

 

 

In fact it is quite simple to hide a file, but for me personally it's not comfortable to enter each time the terminal and I would prefer an alfred workflow.

 

Yeah I was going to chime in and say that chflags would perform this.

 

To create this as a workflow, simply create a new workflow, add a Trigger->File Action, and an Action->Run Script. Set the keyword for the file action, attach it to the Run Script and in the script area of the Run Script module, enter:

chflags hidden "{query}"

 

Also, untick the option to escape spaces.

 

That should get you going.

Link to comment
Share on other sites

The only problem then would be to unhide files. Since Alfred doesn't show them.

Also, if you use a search script, you might be able to have Alfred show you all files on your computer, and narrow down the file you want, by typing.

It's not a problem if you have another workflow that toggles the visibility of files, there are several of these.

If you want i can upload the one i'm using (cause i can't remember where I found it)

 

To create this as a workflow, simply create a new workflow, add a Trigger->File Action, and an Action->Run Script. Set the keyword for the file action, attach it to the Run Script and in the script area of the Run Script module, enter:

chflags hidden "{query}"

Also, untick the option to escape spaces.

 

That should get you going.

 

I hope I'm not asking too much, but since I have no experience in creating workflows nor scrips, there is a chances are you help me with this?
I think you should also add the nohidden command to the workflow, This is how it will be perfect toggle.
Edited by nirsh
Link to comment
Share on other sites

It's not a problem if you have another workflow that toggles the visibility of files, there are several of these.

If you want i can upload the one i'm using (cause i can't remember where I found it)

 

 

I hope I'm not asking too much, but since I have no experience in creating workflows nor scrips, there is a chances are you help me with this?
I think you should also add the nohidden command to the workflow, This is how it will be perfect toggle.

 

You do understand that, once you mark this file as hidden, it will no longer show up in Alfred results correct? So there won't be an option to go back and mark it as nohidden. That would have to be done via the terminal, or, you may be able to make a filter to show the hidden files. The down side to that is, they would may have to be in specified folders because it appears that, changing that flag simply marks them as a system file. If you made a filter to show system files, you would get a lot of results.

Link to comment
Share on other sites

You do understand that, once you mark this file as hidden, it will no longer show up in Alfred results correct? So there won't be an option to go back and mark it as nohidden. That would have to be done via the terminal, or, you may be able to make a filter to show the hidden files. The down side to that is, they would may have to be in specified folders because it appears that, changing that flag simply marks them as a system file. If you made a filter to show system files, you would get a lot of results.

I didn't mean do see them in alfred results but on finder himself, I will explain:

*If I see a file(s) that i want to hide I can mark them and  hit an alfred keyword (or even a hotkey) to make them hidden.

*If I want to unhide a hidden file (than i know his there) I can:

1st - hit an alfred keyword to show all files (I am using one of those)

2nd - mark the file(s) I want to be visible again and use the nohidden command (with different keyword/hotkey) that I want to be in the workflow.

 

I hope I made myself more clear  :)

Edited by nirsh
Link to comment
Share on other sites

See if this is what you are looking for. 

Download

 

Use it as a file action. Find a file in Alfred and action it, select Toggle Visibility. 

I'm sorry but i'm must be missing something cause i don't understand how the workflow works without a hotkey/keyword.

What do you mean by "action it"? how?

Link to comment
Share on other sites

I'm sorry but i'm must be missing something cause i don't understand how the workflow works without a hotkey/keyword.

What do you mean by "action it"? how?

 

Use the result actions. Find a file in Alfred, press the right arrow to see the list of result actions (actions available for that item). If you have a file selected in Finder, press Cmd+Opt+\ to be prompted with the same list of actions.

Link to comment
Share on other sites

Use the result actions. Find a file in Alfred, press the right arrow to see the list of result actions (actions available for that item). If you have a file selected in Finder, press Cmd+Opt+\ to be prompted with the same list of actions.

Nice!

Yes, more or less it's what i was looking for, except if it's possible to do it on some filed at the same time, that would make this workflow perfect

Link to comment
Share on other sites

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...