Re: Hide for OS X

Be warned that Hide restarts your Finder without warning.
This will mess up things you may have running (Copy/Move/Delete, or FinderMinder)

It looks like it’s just a bulky menu item to change your Finder settings:

defaults write com.apple.finder CreateDesktop false

http://cultofmac.com/272595/quickly-hide-icons-desktop-os-x-tips/

Are you sure it the same technique that is used ?

I was wondering if the trick used by the product from Javier Rodriguez was not simply to rename the files in ~/Desktop with a dot to hide, and remove the dot to show.

The files on my Desktop do not have a modification date of today, so I would think that is not the process.

I searched Google for a command to hide the files and that’s what came up. I honestly do not care enough to run strings on the executable and find out for sure, it wouldn’t be worth my time.

There are much smoother ways to achieve the same effect without relaunching Finder. That’s mostly why I’m upset and made this warning post. It did not warn me it would relaunch and it f***** my processes. If anyone’s ever wondering why I constantly b**** about respecting your user, it’s instances like this.

Fun fact: if you have Screenflow this function is built in (and doesn’t change Finder settings)

Relaunching the finder without warning is indeed very rude. And one wonders why the MAS requires sandboxing. Such a mess would not be possible.

While I would not go as far as you do in terms of what should and should not be done, I really believe into warning the user before doing anything potentially dangerous. It would not cost much to have a dialog saying something like “This will relaunch the Finder” [Cancel] [OK].

I just very quickly tried a small program that hides all files on the desktop by changing their name to a dot one. It works fine for files, but aliases do not hide.

Interesting result. I wonder why.

Aliases actually point to files, and for Xojo, the folderItem resolves to the target. I guess it is probably why.

At any rate I believe a hiding program would be possible hiding the files without need to relaunch the finder. The test was not very fast, though. I have quite a few icons, and it took some 3-4 seconds to hide them all, and the same amount of time to show them back.

The best method I’ve seen is to lay a window with the Desktop picture over the Desktop.

To do this in Xojo would require a lot of declares. With Xcode/objc you can set the window level to Desktop level, which floats above the items on the Desktop. So when done properly it looks like the icons just instantly vanish. On the more well-rounded apps that do this, they fade the window in so it looks like the icons fade out. Quite smooth.

[quote=267683:@Tim Parnell]The best method I’ve seen is to lay a window with the Desktop picture over the Desktop.

To do this in Xojo would require a lot of declares. With Xcode/objc you can set the window level to Desktop level, which floats above the items on the Desktop. So when done properly it looks like the icons just instantly vanish. On the more well-rounded apps that do this, they fade the window in so it looks like the icons fade out. Quite smooth.[/quote]

Excellent idea.

It should not be terribly difficult, once you have a way to set the Z-Order of the window to the back. That is an interesting challenge, since all the declares I have seen so far in the forum are for pushing an app/window to the top. I had a look at NSWindowMBS, but there are so many methods I am kind of lost. Perhaps NSWindowMBS.orderBack would do. Maybe Christian would have an idea.

Once that is out of the way, get the backdrop picture of the desktop, make it the backdrop of the window, and position it at 0,0 with size screen(0).width and Height. I just experimented quickly with a plain box window, it very nicely shows the picture under the dock and the menu.

There remains an issue, though : it will be impossible to pin any icons on that mocked up background. Also, the drives will not appear. They probably can be emulated, but it complexifies.

and it becomes infinitly more complex when multiple monitors are involved, and worse yet if some are retina and some are not

Not sure what the attraction of this is… why not just remove the icons you don’t want, or drop them into a folder for later use?

[quote=267696:@Dave S]and it becomes infinitly more complex when multiple monitors are involved, and worse yet if some are retina and some are not

Not sure what the attraction of this is… why not just remove the icons you don’t want, or drop them into a folder for later use?[/quote]

Typical use : you must make a presentation on a projector, and don’t want to show your desktop full of very personal stuff to an entire assistance.

And you don’t want to waste an hour putting them back after storing them away.

so create a “presentation” user account… it is a lot less work than trying to fake a desktop using XOJO… but that just me… I’ll leave you guys to it.

Well you don’t have to create one in Xojo.
In fact, you probably shouldn’t.
Like tip calculators there are a large number of them out there (because they’re so easy to make.)

Plus, if you’re into Screencasting, there’s a hider built into Screenflow - you don’t even need an external app.

There are things that have been done many times, that can be fun to reinvent. It’s just like humor. No need to have a specified purpose. And just alike, not necessarily understood by some.

[quote=267712:@jean-paul devulder]i like backdrop app (free)

mac store app link: [/quote]

That is exactly what I did in ten minutes in Xojo. Simple.

Thank you for the link, though.

I’m surprised the OS doesn’t do that.

As for placing a window behind all others I’ve been doing that for some time and it works great, however my intentions are a little different. I work in the dark a lot and made this app for an easy source of light (the window opens solid white). It doesn’t work so well as a faux-desktop because the window slides away when you do Mission Control or show Desktop or show Application Windows. I like it though because with my nightlight app I can still get to my desktop icons.

Also its the smallest app I use on a regular basis. Other than the Window.Open event (below) there’s a ContextualMenu menu to quit or switch the color to black.

Uncomment the setCollectionBehavior lines and the window won’t slide away during Mission Control et al.

[code]Sub Open()

'soft declare sub setCollectionBehavior lib “Cocoa.framework” selector “setCollectionBehavior:” _
'(id As integer, newVal As UInt32)
'setCollectionBehavior(self.Handle, Bitwise.ShiftLeft(1, 4))

soft declare function CGWindowLevelForKey lib “Cocoa” (key as integer) as integer
soft declare sub setLevel lib “Cocoa” selector “setLevel:” (id As integer, newLevel As integer)
const kCGDesktopIconWindowLevelKey = 18

setLevel(self.Handle, CGWindowLevelForKey(kCGDesktopIconWindowLevelKey) + 1)

Top = 0
Left = 0
Width = Screen(0).Width
Height = Screen(0).Height

BackColor = &cFFFFFF
HasBackColor = true

End Sub
[/code]

[quote=267743:@Will Shank]I’m surprised the OS doesn’t do that.

As for placing a window behind all others I’ve been doing that for some time and it works great, however my intentions are a little different. I work in the dark a lot and made this app for an easy source of light (the window opens solid white). It doesn’t work so well as a faux-desktop because the window slides away when you do Mission Control or show Desktop or show Application Windows. I like it though because with my nightlight app I can still get to my desktop icons.

Also its the smallest app I use on a regular basis. Other than the Window.Open event (below) there’s a ContextualMenu menu to quit or switch the color to black.

Uncomment the setCollectionBehavior lines and the window won’t slide away during Mission Control et al.

[code]Sub Open()

'soft declare sub setCollectionBehavior lib “Cocoa.framework” selector “setCollectionBehavior:” _
'(id As integer, newVal As UInt32)
'setCollectionBehavior(self.Handle, Bitwise.ShiftLeft(1, 4))

soft declare function CGWindowLevelForKey lib “Cocoa” (key as integer) as integer
soft declare sub setLevel lib “Cocoa” selector “setLevel:” (id As integer, newLevel As integer)
const kCGDesktopIconWindowLevelKey = 18

setLevel(self.Handle, CGWindowLevelForKey(kCGDesktopIconWindowLevelKey) + 1)

Top = 0
Left = 0
Width = Screen(0).Width
Height = Screen(0).Height

BackColor = &cFFFFFF
HasBackColor = true

End Sub
[/code][/quote]

Thank you so much Will.

Sorry… I’m late on this.

“Hide for OS X” doesn’t renames files, doesn’t mess with defaults either.

Javier

Thank you so much Michel Burjardet for your constructive Feedback! I’ve implemented the dialog box asking for permission, and it’s already available for download (and included it in the Read Me file, too).

I know that sometimes is too complex to contact directly the developer to give feedback (time). I want to thank you because I could read it here!

This is a great forum, and an excellent developer comunity also for things like this one!

I’ll try to improve it even more on next releases! :slight_smile:

Javier

This app only set the visible property of a FolderItem to false. No magic at all. :slight_smile:

Dim testFile as FolderItem testFile.Visible = False

To show it again

testFile.Visible = True

This will not alter the creation and/or modification dates of the file itself nor does it change the filename.

Also,it is easily recovered/bypassed by using the Terminal command:

defaults write com.apple.finder AppleShowAllFiles YES
killall Finder (hence why this app needs a Finder reset)

There are declares (see above) to do the same way as ScreenFlow does, so you can even put it on AppStore.

[quote=267637:@Tim Parnell]It looks like it’s just a bulky menu item to change your Finder settings:
defaults write com.apple.finder CreateDesktop false[/quote]

In that case the Volume icons would be gone too. “Hide for OSX” just sets the file.visible property to false.