|
|||||||
| Development XCode, Cocoa, and all other development |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
| 04-12-2007 | #1 (permalink) | ||
|
TAB Author
|
I'm hoping someone out there in the TAB community knows a lot more about Applescript than I do. In fact, you only need to know a little bit and I'm sure you could help
![]() Anyway, I have this little piece of code, written to grab a bunch of files in a folder, and dump them into another folder, overwriting if necessary. Here's just a piece: Quote:
Quote:
|
||
|
|
|
| Sponsored Links | |
|
|
|
| 04-12-2007 | #2 (permalink) |
|
Mac Genius
|
Okay, I am no scripter, but here's an option to overcome all these issues: get Automator to do it for you.
Try doing something like "Get Selected Finder Items" (or "Get Sepcified Finder Items" or "Get Folder Contents" or something, there are loads of options). Then try "Copy Finder Items" and choose to Show Action When Run and choose to show either, both or neither of the options "Replace Existing Files" and "To". This will do the same thing without being capable of messing up. You can then save this as a workflow or application, add it to your AppleScript menu item or even save it as a plug-in for Finder where you can then right click and item, choose Automator and hey presto, there is the option. Would this be suitable or I may have missed something?
__________________
MacBook Pro 15" Glossy, 2.6GHz, 4GB RAM, 320B HD | iPhone 3G 16GB (Black) |
|
|
|
| 04-12-2007 | #3 (permalink) |
|
Concierge
|
This worked for me:
Code:
tell application "Finder" duplicate files in folder "untitled folder" of desktop to folder "New" of desktop replacing yes end tell Try throwing in a lot of "of" statements. For example, "folder update-files of folder vinyl-updater of desktop" Last edited by mdmunoz; 04-12-2007 at 04:31 PM. |
|
|
|
| 04-12-2007 | #4 (permalink) |
|
TAB Author
|
Matt - I would use Automator in a heartbeat... but in this case it's something I would like to distribute to other people. It's basically an update script for some specialized software that has crappy mac support and even worse customer service (another story). So they issue this patch, but he script doesn't actually work - so I was hoping to tweak it and put it back out there for people to actually use
![]() I'm going to try mdmunoz's approach tonight... I'll see how many "of"s I can get in there. The reason the "Users:mdmunoz esktop..." was in there was so that it could work on everyone's machine, since it was using the default install directory. If I really wanted to get fancy, I could put in a little search string to actually find the folder it's installed in... hmmm... |
|
|
|
| 04-12-2007 | #5 (permalink) |
|
Mac Genius
|
Okay, so I missed something. automator should still work though as it can easily adjust the locations and be saved to be sent to others however you'd like. (I have to back up my ideas to make myself feel better at least
)
__________________
MacBook Pro 15" Glossy, 2.6GHz, 4GB RAM, 320B HD | iPhone 3G 16GB (Black) |
|
|
|
| 04-13-2007 | #6 (permalink) | |
|
Concierge
|
Quote:
Automator is awesome, though. GUI scripting with visual feedback is the way of the future. You heard it here first! I could try and write an Automator action out of whatever Applescript you come up with, if you want. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|