finder

How to refresh finder window?

血红的双手。 提交于 2019-12-03 20:41:44
I want to refresh icon for particular file/folder in Finder application. FNNotifyByPath( (const UInt8 *)folderPath, kFNDirectoryModifiedMessage, kNilOptions ); FNNotifyByPath is not working for this. Now i am trying with appleScript +(void) refreshIconForItem : (NSString *)itemPath { NSString *source=[NSString stringWithFormat:@"tell application \"Finder\" to update \"%@\"",[NSString stringWithUTF8String:itemPath]]; NSAppleScript *update=[[NSAppleScript alloc] initWithSource:source]; NSDictionary *err; [update executeAndReturnError:&err]; } but this function is also not working. Can anyone

How can i add icon overlay in finder?

心不动则不痛 提交于 2019-12-03 15:06:08
When we open Dropbox folder, we can see icon on the left bottom of the folder. I am developing an application in which i also want the same behavior. If folder is syncing then it will show sync icon and for other operation it will show other icon. The marked files/folder when viewed in Finder must be shown with a custom icon. But when they are selected for preview ( using spacebar) they must show their original icon ( i.e the blue icon for folder etc) . Can anyone please help me out ?? Thanks :) Starting with Yosemite (10.10), there is now an officially supported (and thus Mac App Store

What's the cleanest way to override ActiveRecord's find for both models and collections?

允我心安 提交于 2019-12-03 14:02:31
问题 I have library code that overrides Ar's find method. I also include the module for all Association classes so both MyModel.find and @parent.my_models.find work and apply the correct scope. I based my code off of will_paginate's: a = ActiveRecord::Associations returning([ a::AssociationCollection ]) { |classes| # detect http://dev.rubyonrails.org/changeset/9230 unless a::HasManyThroughAssociation.superclass == a::HasManyAssociation classes << a::HasManyThroughAssociation end }.each do |klass|

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

…衆ロ難τιáo~ 提交于 2019-12-03 12:39:01
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 the first URL: NSArray *pasteTypes = [NSArray arrayWithObjects: NSURLPboardType, nil]; NSString *bestType = [pboard availableTypeFromArray:pasteTypes]; if (bestType != nil) { NSURL *url = [NSURL URLFromPasteboard:pboard]; } The IKImageKit programming topics outline

Unable to add item in Finder's contextual menu using services in Cocoa

眉间皱痕 提交于 2019-12-03 07:33:23
问题 I would like to add an item in my Finder's contextual menu whenever I right-click on files or folders, and this menu being linked to a method of my Cocoa app. I am following CocoaDev's example and Apple's documentation, but I can't get the service being displayed. Here is my .h #import <Cocoa/Cocoa.h> @interface AppDelegate : NSObject <NSApplicationDelegate,NSObject> @property (assign) IBOutlet NSWindow *window; -(void)IClicked:(NSPasteboard *)pboard userData:(NSString *)data error:(NSString

What is the quickest way to toggle hide/show hidden files on a Mac OS X Yosemite?

限于喜欢 提交于 2019-12-03 07:30:50
问题 I'm on Yosemite, and I want to toggle hide/show all the hidden files on a Mac. Every-time, I want to do that I have to go to Terminal.app and run these command : To show defaults write com.apple.finder AppleShowAllFiles TRUE To hide defaults write com.apple.finder AppleShowAllFiles FALSE I'm wondering if there is a better tweak out there that accomplish this in just a click of a button. 回答1: I prefer using this shortcut: ⌘ CMD + ⇧ SHIFT + . 回答2: Update, considering all comments: try set state

Ways to invoke python and Spyder on OSX

狂风中的少年 提交于 2019-12-03 00:29:54
问题 I recently bought a MacBook and install Python on it via Anaconda. Here's the version information: Python 2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Nov 11 2013, 10:49:09) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin I'd like to be able do all of the following: Launch Spyder without having to go through the Launcher application (say, by typing things into Spotlight and Quicksilver) Run Python code from the Finder, presumably by double-clicking on my .py file or by selecting and and pressing

What is the quickest way to toggle hide/show hidden files on a Mac OS X Yosemite?

痞子三分冷 提交于 2019-12-02 23:57:19
I'm on Yosemite, and I want to toggle hide/show all the hidden files on a Mac. Every-time, I want to do that I have to go to Terminal.app and run these command : To show defaults write com.apple.finder AppleShowAllFiles TRUE To hide defaults write com.apple.finder AppleShowAllFiles FALSE I'm wondering if there is a better tweak out there that accomplish this in just a click of a button. I prefer using this shortcut: ⌘ CMD + ⇧ SHIFT + . Update, considering all comments: try set state to (do shell script "defaults read com.apple.finder AppleShowAllFiles") as boolean on error set state to false

AppleScript set directory path in Finder

感情迁移 提交于 2019-12-02 18:01:32
问题 I'm trying to delete a file on my computer via AppleScript. When I apply the code below, it seems to delete the file from desktop. I'd like to delete the file in the "/Users/andrew/Documents". This is the code below which deletes the file from the desktop: tell application "Finder" if exists file "new.mp3" then delete file "new.mp3" end if end tell This is what tried and it doesn't work: tell application "Finder" if exists file "/Users/andrew/Documents/new.mp3" then delete file "/Users/andrew

AppleScript set directory path in Finder

你说的曾经没有我的故事 提交于 2019-12-02 08:16:45
I'm trying to delete a file on my computer via AppleScript. When I apply the code below, it seems to delete the file from desktop. I'd like to delete the file in the "/Users/andrew/Documents". This is the code below which deletes the file from the desktop: tell application "Finder" if exists file "new.mp3" then delete file "new.mp3" end if end tell This is what tried and it doesn't work: tell application "Finder" if exists file "/Users/andrew/Documents/new.mp3" then delete file "/Users/andrew/Documents/new.mp3" end if end tell If anyone could any advice it would be much appreciated!! Add POSIX