finder

Applescript: Get filenames in folder without extension

寵の児 提交于 2019-12-17 21:02:36
问题 I can get the names of all files in a folder by doing this: tell application "Finder" set myFiles to name of every file of somePath end tell How can I change the strings in myFiles so that they do not include the file extension? I could for example get {"foo.mov", "bar.mov"} , but would like to have {"foo", "bar"} . Current solution Based on the accepted answer I came up with the code below. Let me know if it can be made cleaner or more efficient somehow. -- Gets a list of filenames from the

Finder update/refresh applescript not working in 10.8

不羁岁月 提交于 2019-12-17 19:54:20
问题 I have been using apple script for updating display for files and folders in finder. This is simplified version of that script: tell application "Finder" tell window 1 to update items end tell I can see that since 10.8 (Mountain Lion) update command is not properly executed or is not executed at all. Until 10.8 everything was working perfectly - Immediately after update command all icons got redrawn. I use this for showing overlay icons. Have any of you encountered same problem? I blame

Add Item to Finder Sidebar

天涯浪子 提交于 2019-12-17 19:45:46
问题 I would like to add a new item to the Finder sidebar. I found out that the Finder keeps the list of "places" in `~/Library/Preferences/com.apple.sidebarlists.plist. I was able to read the file using Carbon API and saw that each item had Name, icon and alias. Using a 3rd party application such as PlistEdit Pro I was able to update the alias. My question is how to update the alias using Carbon API. Was not able to find a way to create alias that will open in Finder. It seem that both Dropbox

Open terminal here in Mac OS finder [closed]

人走茶凉 提交于 2019-12-17 17:17:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. Is there something similar to the "Open Command Window Here" Windows Powertoy for Mac OS? I've found a couple plugins through a google

How to get Finder sidebar favorites content cocoa?

笑着哭i 提交于 2019-12-14 03:39:52
问题 I need to get paths of objects displayed in Favorites section of Finder Sidebar (for current user). How can I achieve this? 回答1: Getting the shared file list is only the first part, you still may want to get an actual string object with your path. Here is a little code snippet that will let you get a path for each object in the favorites section of the finder sidebar. UInt32 seed; LSSharedFileListRef sflRef = LSSharedFileListCreate(NULL, kLSSharedFileListFavoriteItems, NULL); CFArrayRef items

Add custom menu items to the Finder context menu

懵懂的女人 提交于 2019-12-13 13:35:03
问题 How do I add custom menu items to the context menu for files in Finder? Unfortunately, most of the information out on the Internet and on Stack Overflow doesn't work in 10.6 or are too limited. Automator, for example, doesn't allow you to create items dynamically or create submenus. I know it's still possible to do this sort of thing because Dropbox and FolderGlance both do similar things. Does anyone know how they implemented this? Thanks. 回答1: I downloaded FolderGlance and it appears to use

How to refresh browser view in finder window(mac os 10.5)?

大兔子大兔子 提交于 2019-12-13 08:35:36
问题 I want to refresh all NSTableView in NSBrowserView of finder on mac os 10.5. For refreshing icon view , list view and flow list view, i am using apple script. @"tell application \"Finder\" to update every item in front window" In browser view this script is only refreshing last column. For example , this script is refreshing only third column(icns-copy.m.....). Can anyone please help me out? 回答1: It's only refreshing the last column because every Finder window has exactly one target folder at

Xcode project file size is rather large

∥☆過路亽.° 提交于 2019-12-13 05:03:18
问题 Ok, so I am close to submitting my WWDC scholarship app, however I have just noticed that the file size for my Xcode project is 130mb. The limit is 100mb. When I click 'get info' on the project folder in the 'Developer' folder, it tells me that it's 130mb, but then if I go into that folder and check the three folders sizes, one is 53mb and the other two are tiny... So why is it telling me that it's 130mb overall? Also, I've just checked it again and without changing anything, it's gone up to

Swift - warning when choosing files (Cocoa)

南笙酒味 提交于 2019-12-13 03:35:31
问题 I want to make a button in my app to select files with Finder using Swift. @IBAction func selectFiles(sender : NSButton) { let openDlg = NSOpenPanel() openDlg.allowsMultipleSelection = true openDlg.canChooseFiles = true openDlg.canChooseDirectories = true if openDlg.runModal() == NSOKButton{ files = openDlg.URLs } } When I run this code, the following warning occurs. Unable to simultaneously satisfy constraints: ( "<NSAutoresizingMaskLayoutConstraint:0x608000095450 h=-&- v=-&- H:|-(0)-[NSView

How to make icons in a specific folder unmovable in MAC OS X?

二次信任 提交于 2019-12-13 02:57:34
问题 I installed VMTools for MAC OS X. And this is its UI: I known that this was simply a folder. But what make me curious was that I could not drag and re-position those two icons. How can I achieve this? 回答1: You can set the window to "Sort By..." or "Arrange By..." some criteria. If you open the window and choose "Show View Options" from the "View" menu, you should see various options for those. Choosing "By Name", for example, will keep them sorted by name and not allow them to be moved around