finder

How does one relaunch Finder programmatically?

If I ALT+RIGHTCLICK on the Finder icon, I get a "Relaunch" option in the context menu. I would like to programmatically relaunch finder, if at all possible. I'm sure there is a better way to do it than to just kill it and let it restart. Assume I have the proper authorization / permissions to do so already. Additionally, I would like...

Looking for something better than Zemanta and Apture

I'm looking for some tool like Zemanta or Apture to embed in a self developed cms, but I wonder if does exist something less tricky. From a end user point of view, Apture (www.apture.com) does a fantastic job, but its javascript layer on top of the web page (bad solution, to me) and the fact that there isn't any plugin available for FC...

How to access / embed Finder functionality?

Is it possible to embed Finder functionality in a cocoa app, now that Finder is itself cocoa (assuming the app were to function only in snow leopard)? What I mean is to have a file browser pane as part of the app, actually browsing the file system itself (to edit in another pane), but without writing all the functionality of the Finder....

Add an item to the Finder/Save dialog sidebar

I'm working on a script where a user logs into a guest account on OS and is prompted for their network credentials in order to mount their network home folder (while they benefit from working on a local user folder). As the guest folder is deleted when users log out, I want to discourage them from saving anything there. I would like ...

Is there a programmatic way to refresh / reset a preview icon in Finder?

I noticed that while this applescript: tell application "Finder" {...} update itm with necessity {...} end tell refreshes normal Finder icons, on the other hand, it doesn't refresh the Preview icons under Leopard. I'm wondering if there's an AppleScript / Carbon / Cocoa / C way to refresh or reset a preview icon of a Finder file...

Finder Plugin in Snow Leopard

Hi, Since the Finder in Snow Leopard has been rewritten to use Cocoa instead of Carbon, I'd like to know if there's a new API to write Finder plugins. The old way involved writing a CFPlugin but this doesn't seem to work anymore. ...

User properties/ privileges in AppleScript

I want to write an applescript program that first checks to see if the user has Admin privileges, and if it doesn't then requesting a re-log-in or something. Eventually the script is going to need to do a sudo chmod of a folder I just created... I can do that with a do script and a with Administrator Priviledges. However I haven't figu...

How does the Mac OS X Finder recognize a PNG file?

I have a file which was originally named 'foo' in the Finder. If I 'get info' for the file, the Finder recognizes it as "Kind: Plain text". If I rename the file as 'foo.png', Finder then recognizes it as "Kind: Portable Network Graphics image". If I rename the file as 'foo', Finder still recognizes it as "Kind: Portable Networks Graph...

How do you show the Finder context menu from a Cocoa application?

I have a file listing in my application and I would like to allow people to right-click on an item and show the same contextual menu as Finder does. Is this possible? The same functionallity but for Windows Explorer is discussed in http://stackoverflow.com/questions/451287/how-do-you-show-the-windows-explorer-context-menu-from-a-c-appl...

After forced quit, "killall Finder" says "No matching processes..." but PID still exists?

Here's one for ya. Upon a forced quit of the Finder with unsuccessful relaunch, "killall Finder" in terminal returns: "No matching processes belonging to you were found" Oddly enough, the PID for finder does actually show up after a "ps -A" to reveal all processes. But the time is perpetually listed as 0:00:00, upon repeated PID listi...

How does one feed a list of files into an app with appscript and Python?

Get your newb-shields up, I'm about to sprinkle you with some. I'm trying to get Photoshop CS4 to open a folderful of JPEG images with AppScript+Python, which could be described like so in BASH: #!/bin/bash for F in `ls ~/Desktop/test`; do open -a "Adobe Photoshop CS4" $F # proceed to mutilate the image appearance done I'm f...

How do I handle multiple file drag/drop from Finder in Mac OS X 10.5?

I need to get the URLs of all files dragged/dropped into my application from Finder. I have a Cocoa app running on 10.6 which does this by using the new 10.6 NSPasteboard APIs which handle multiple items on the pasteboard. I'm trying to backport this app to 10.5. How do I handle this on 10.5? If I do something like below, I only get ...

How to trigger a script after duplicating/copying a directory in Mac OSX/Finder

In Snow Leopard, I want to trigger a script/code whenever a user duplicates a directory in Finder. How can I do that? I've been hunting around the docs, but I'm a little too new this type of work to recognize the right approach. Motivation: If a directory is under version control, say with git or hg or svn, and the user duplicates tha...

How to write OSX finder new functionality/view

Hi, I am new to Mac programming and I wan't to make a sort of plugin that change the standart view of files in Finder and add some custom buttons. Any idea how can I accomplish it or where to start? Thanks a lot, Adam ...

Parse DS_Store w/ PHP

Ok, I know this is a longshot, but I'm going to ask anyway... I develop web applications locally on my computer and use the normal Apache directory index to navigate amongst the directories of project. When I am in Finder, I label certain directories with color labels to highlight what is current. Wondering if there is a way to determi...

What's the most simple way to get files only visible in Finder in a directory?

NSFileManager has several method to enumerate directory contents, but they returns all files including hidden or system files which is invisible for users in Finder. I want to get the file list same as Finder. As possible as simple. What do I have to do? ...

Finder applescript: Odd behaviour

I'm on OSX Snow Leopard (I had the same issue on Leopard, though..) This is the applescript: tell application "Finder" to set my_from to selection tell application "Finder" to set my_to to target of window 2 tell application "System Events" to keystroke (ASCII character 31) tell application "Finder" to move my_from to my_to It moves t...

Cocoa: is it safe to assume that the destination URL for delivering on an NSFilesPromisePboardType is a file URL?

Is it safe to assume that the destination URL passed to an outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems: method (as specified by the NSOutlineViewDataSource protocol) is always a file URL? In the implementation of such a method I'm making use of NSDictionary's writeToURL:atomically: to write out a ".webloc" prope...

Tagging files with colors in OS X Finder from shell scripts

One can tag files and folders with a color in the Mac OS X Finder. Is there a way to do this from a shell script? ...

Locate RFID tag using iPhone

Hi all, I am looking into building an app (on my laptop to start) that would be able to locate the signal emitted by an RFID tag (non passive). Say I attach this to my key ring, what would be required of the application to triangulate the location of the RFID tag in a 10m range. Would this even be possible using this technology? I see s...