Automator: Apply Color Label and Copy to Folder

I'm trying my hand at Automator, and I need help with one of my workflows (⇪). Basically, it's a service (accessible via right-click) that will apply a color label on an image file, and then copy that image file to a corresponding folder with the same color label. My current version works fine, except for the fact that I had to create seven versions to accommodate all seven colors.
Is there any way to turn the color into a variable? I want the workflow to prompt me for a color, and then use that choice to run a search for the appropriate folder. I'd rather not hard code the color choice into separate services that all do the same thing.
Also, the service currently assumes that it will run fast enough before I can deselect the target file. I'm sure it's possible that the folder search could lag out while I select another file, and the service will ultimately copy the newly selected item, rather than the initial target. Is there a way to ensure the service acts on whatever was selected when it was first triggered?
I don't know AppleScript beyond copying-and-pasting other people's codes, so that limits my automation quite a bit. I don't know how to prompt for a label index choice and then feed the result into a find function. I also don't know how to record the file path of the selected item, and then feed that into the copy function at the end to ensure it doesn't copy the wrong file.

Typically a list of items is passed to a workflow, so you will usually (depending on what you are doing with the items) need to step through the items in that list. If there is only one destination folder with the target label, you can just search for it, otherwise you will need to specify the destination in some other way.
The following Service workflow example assumes that there is only one destination folder that has a given label color. It gets the label index of one of the input items and finds a folder with the same index at a specified base location (to limit the search range).
1) Input items are automatically passed to an application or service, otherwise another action to get FInder Items can be used
2) *Label Finder Items* (show the action when the workflow runs)
3) *Run AppleScript* (paste the following script)
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #DAFFB6;
overflow: auto;"
title="this text can be pasted into an Automator 'Run AppleScript' action">
on run {input, parameters} -- copy to a labelled folder
This action is designed to follow a "Label Finder Items" action.  It will get the
first folder of the base folder that has the same label and copy the input items
to that folder.
input: a list of Finder items received from a "Label Finder Items" action
output: a list of Finder items to be passed on to a following action
set output to {}
set skippedItems to {} -- this will be a list of skipped items (errors)
set baseFolder to (((path to pictures folder) as text) & "Shelley:Mary:") as alias -- a place to start looking for the destination folder
tell application "Finder"
set theLabel to label index of (the first item of the input) -- just pick one, they should all be the same
get folders of (entire contents of baseFolder) whose label index is theLabel -- include subfolders
-- get folders of  baseFolder whose label index is theLabel -- no subfolders
if the result is not {} then
set theDestination to the first item of the result
else -- no folder
error number -128 -- cancel
end if
end tell
repeat with anItem in the input -- step through each item in the input
try
tell application "Finder" to duplicate anItem to theDestination
set the end of the output to (the result as alias)
on error number errorNumber -- name already exists, etc
set errorNumber to "  (" & (errorNumber as text) & ")"
-- any additional error handling code here
set the end of skippedItems to (anItem as text) & errorNumber
end try
end repeat
showSkippedAlert for skippedItems
return the output -- pass the result(s) to the next action
end run
to showSkippedAlert for skippedItems
show an alert dialog for any items skipped, with the option to cancel the rest of the workflow
parameters - skippedItems [list]: the items skipped
returns nothing
if skippedItems is not {} then
set {alertText, theCount} to {"Error with AppleScript action", count skippedItems}
if theCount is greater than 1 then
set theMessage to (theCount as text) & space & " items were skipped:"
else
set theMessage to "1 item was skipped:"
end if
set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {skippedItems, AppleScript's text item delimiters} to {skippedItems as text, tempTID}
if button returned of (display alert alertText message (theMessage & return & skippedItems) alternate button "Cancel" default button "OK") is "Cancel" then error number -128
end if
return
end showSkippedAlert
</pre>

Similar Messages

  • Lightroom 5 and Bridge 6- Color Label and Keyword compatibility

    I've added color labels and keywords to images in Lightroom 5 but I'm not seeing them in Bridge CC.
    Lightroom Metadata > Color Label Set is set to Lightroom Default (Red-Yellow etc.
    And Bridge Preferences > Labels is also set with "Red, Yellow etc" text. 
    In other words they are the same,  But I'm not seeing the color labels or the keywords in Bridge. 
    Thanks,

    The answer to this problem is that, in order for Bridge and Lightroom to share labels etc. Lightroom has to write its metadata into xmp sidecar files.
    To do this go to: Lightroom > Catalog Settings > Metadata Tab and check : Automatically write changes into XMP.

  • Close all folders in Mail?  Color Label folders?  Find folder?  And More!

    Hi all.
    I have a LOT of mail. They're all very organized, though. Heaps of Mailboxes (Folders) and Sub-folders.
    I also have heaps of rules dutifully sending incoming mail to their appropriate mailboxes.
    However...
    It has reached a point where one of of the major bottlenecks in my daily workflow is sorting through all these mailboxes.
    There are 5 primary mailboxes with perhaps 100-ish subfolders or sub-subfolders. Maybe more.
    When they are all open, or a lot of them are open, it is difficult to find the a specific folder when I need it. It would help if I could close all open folder with a shortcut.
    Is this possible?
    It would also help if I could visually distinguish each level. Can I color label the mailboxes(not the messages themselves)?
    Another help would be if I could run a search for a folder Mailbox name. Is this possible?
    Lastly when I create a rule I would love it if there was an option to 'Create new Mailbox' in the rule dialog box rather than having to create the mailbox first. Am I just missing this? See link for illustration:
    http://img.skitch.com/20080820-eaqmy89emw6xm5pcj86iuqu992.jpg

    I just had a look and you need to create the mailbox PRIOR to asking the rules to move it into that.
    Now, automator lets you create a new workflow, but not sure as to how to set that one up (might be possible; however, my mathematical brain tells what you want to achieve is flawed:
    1) IF new mail equals "tangerine", create new mailbox tangerine, then move message to mailbox "tangerine. (FINE so far!)
    2) the second "tangerine" message arrives, and the workflow should FAIL (because it cannot create a "new" mailbox "tangerine", as there is ALREADY a mailbox named "tangerine")
    3) if automator cannot execute "If" and "and" and the "sort by" all together, then distinguish (a "tangerine" message might actually need to go to "pear" but refers to "pears and tangerines", so it ends up in the wrong mailbox), you may have to start and restart mail, until all stages of the script have been executed.
    You see the problems?
    Anyhow, here is a link to some automator info:
    http://automatorworld.com/archives/automator-for-os-x-105-leopard-revealed/
    Good luck

  • I have 2 yr old Iphone 4 and have not backed up or connected to Itunes or backed up for 1 yr. I have new computer and want to connect and copy Itunes folder from external HD to new computer and install Itunes. What steps should I take and what precautions

    I have a 2 yr old Iphone 4 and have not backed up or connected to Itunes up for 1 yr. I have new Windows 7 computer and want to connect and copy Itunes backed up folder from external HD (a year ago) to new computer and install new Itunes and new IOS. What steps should I take and what precautions? I don't want to lose any data on my phone such as music, photos, contacts, notes, texts etc, nor lose music from prior backed up Itune folder. Apps should be OK from app store? Thanks for any help.

    Hello CosK,
    The following guide can step you through the process of using a backup of your iPhone 5 to transfer your content to your iPhone 5s.
    Transfer content from an iPhone, iPad, or iPod touch to a new device
    http://support.apple.com/kb/HT2109
    Should one or both of your phones fail to appear in iTunes, the following article provides troublesooting steps that can assist.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Cheers,
    Allen

  • Loss of color labels and other assorted bad things...

    My G5 seems to be acting a little weird lately- nothing I can pin down but lots of little things.
    • Beachballs spinning at odd times and places.
    • If I have assigned a color label to a TextEdit document, all of a sudden resaving the document causes the color label to reset to "no color". This seems to be a new trick, and I'll bet nothing good will come of that.
    • When opening some (but not all) graphic files with GraphicConverter, all of a sudden a "ghost image" of the picture paints itself on my right screen (of a two-screen setup). The actual GraphicConverter window itself is located on the left screen real estate, which is where I want it, but this "ghost image", without any framing, appears right in the middle of the right screen just after the normal GraphicConverter window opens on the left screen. Suspiciously, the size of the "ghost image" seems to be the same size as the actual legitimate image showing in the GraphicConverter window. I have my screen set to change the background picture every minute or so, and when it repaints the "ghost image" disappears. Moving any other window over the "ghost image" also erases it (like using a blackboard eraser).
    Just to make this REALLY challenging, this problem seems to be inconsistent, as it does not do this every time. If there is a pattern here, I'm missing it.
    So far (I think, but can't be sure) all of the graphics which fall victim to this phenomena have been scans by my Cannon scanner. Have had this scanner for a long time with no previous problems. If I open the same files which cause GraphicConverter to misbehave with other graphics-handling apps, there doesn't seem to be any problem with the other apps.
    Some general background info:
    • Have reinstalled the GraphicConverter app, and discarded it's preference files, but no help.
    • Have also reinstalled the Cannon driver app, and discarded it's preference files, but again no help.
    • If I boot the computer from a different (backup) external HD the same situation seems to exist. However, since I backup pretty often (using SuperDuper), if there is some sort of OS issue which has been building up it may be possible that the backup HD now simply has the same problem as the main internal HD.
    • I did rebuild my directories with DiscWarrior a few weeks ago, for what that's worth. Have done that in the past with no problems occurring.
    • The main internal HD is a fast 10000 rpm, and is partitioned into two sections: one section holds all of the OSX-10.4.10 and related operating files (apps, utilities, libraries and associated hooga-booga), with about 9.2gb still open. The other partition holds everything else, also with about 9.2gb still open. Three separate external HDs hold pretty much nothing but music files for iTunes.
    All ideas will be appreciated!
    Thanks- 0db
    Message was edited by: Daniel Banchero
    Message was edited by: Daniel Banchero

    Have just noticed activity monitor is indicating very unusual activity in something called "TruBlueEnvironment", whatever that is. It is currently accounting for over 95% of CPU activity, and these spikes may be the cause of the beachballs appearing at rather odd times.
    For anyone who knows what this may be all about, here are some current stats from the Activity Monitor:
    Threads: 15
    Ports: 227
    Context Switches: 3994556 and going up rapidly
    Faults: 19059 (and stationary)
    Page Ins: 2245 (and stationary)
    Mach Messages In: 56585 and going up fast
    Mach Messages Out: 122817 and going up fast
    Unix System Calls: 80243 and going up
    Can anyone give me some guidance on all of this?
    Thanks-
    0db

  • Automator : issue with variable and path to folder

    I created a simple Automator Workflow with: A variable "Document Folder" and an action "Run shell script" with this command:
    "rsync -E -a -v -z --delete $@ /Volumes/MyBook/Backup/"
    I tested this command, It works very well in the terminal. But return me an error with Automator.
    "$@" is replaced by the Path when running, I guess my issue is that the content of the variable is " ~/Documents " . When it pass to the script it become "/Users/login/~/Documents".
    That can't works.
    A solution would be to put in the script the full path instead of "$@" but I would liketo understand why this error occur.
    Thanks.

    Automator actions return their results as a list of items. If you want your shell script to use the result of an action (for example Ask for Finder Items) as arguments, you need to set the Pass input: as arguments option, and place your statement in the for loop:
    for f in "$@"
    do
          /usr/bin/rsync -E -a -v -z --delete "$f" /Volumes/MyBook/Backup/
    done

  • Colors original and copy/scan don't match

    I made a scan or copy of a diploma which has different light-green colors.
    The duplicate that came out has no greens but mainly purple and pink stripes all over.
    What is the problem and how can it be fixed?
    Rick

    Hello Voetenvos,
    Welcome to the HP Forums.
    I see that you are having an issue with the colours on the print outs.
    Please make sure that you have the printer power cable connected directly to a wall outlet and not a power bar/strip. Here is a document that uses a LaserJet printer as an example but it is meant for HP products in general. Please click on the following link that explains the Issues when Connected to an Uninterruptible Power Supply/Power Strip/Surge Protector.
    I have also located a document that deals with Fixing Print Quality Problems for the HP Officejet Pro 8600 e-All-in-One Printer Series.
    Please feel free to write me back with any other questions or concerns.
    If the troubleshooting does not help resolve your issue, I would then suggest calling HP's Technical Support to see about further options for you. If you are calling within North America, the number is 1-800-474-6836 and for all other regions, click here: click here.
    Thanks for your time.
    Cheers,  
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • Smart Folder not recognizing color labels

    I'm trying to set up a smart folder for photos that have a particular color label. It's not working for some reason. It works with ratings, and with flags, but not color labels.
    It's not a speed issue (I've come back to them hours later - still empty).
    Any suggestions on how to correct this problem?

    You'll need to describe what you're doing a bit more. I have multiple smart folders that search for color labels and it works.
    Where are you setting the smart folder? Are you sure the scope of the smart folder is searching in the correct place? What if you search from the smart album attached to the browser?

  • ACL's and color labels...

    The short version: I setup some ACL stuff (that I don't really understand) in order to share some files that previously belonged to only one user. Now I can't change the color labels in Finder.
    The long version:
    I share an iMac at work and recently decided to create my own account to keep my settings separate from the other person's. I tried moving our projects folder, managed fonts folder, iPhoto library, etc. into the Shared user folder, but iPhoto wasn't having it. The original account was fine with the change, but my new account was locked out. So, I found a little tutorial online (link below) about sharing the iPhoto library in the Shared user folder with some Access Control List (ACL) stuff. Anyway, I have everything running smoothly, but I can't seem to change the color labels in Finder. I control+click the folder and all the color label options are "grayed" out; I can't click on them. I was able to set a color label to a new folder, but I can't remove or change the label on an old folder.
    Here's the command I used, followed by a link to the complete tutorial I used:
    sudo chmod +a "UserName allow delete,chown,list,search,add_file,\
    addsubdirectory,delete_child,file_inherit,directoryinherit" \
    /Users/Shared/iPhoto\ Library
    http://www.macosxhints.com/article.php?story=20050904072808460&lsrc=osxh
    So.... what's going on and how do I fix it? ; )
    Oh yeah, the iMac is a 2 GHz Intel Core Duo with Mac OS X 10.4.11
    Message was edited by: Iynque

    you need to expand that command a little.
    Try this one
    *sudo chmod -R +a "staff allow list,addfile,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr, writeextattr,readsecurity,writesecurity,chown,file_inherit,directoryinherit" path/to/folder*
    as before, instead of path/to/folder put the path to the folder you are doing this to.

  • I can select a rating and a color label for my images, but I can not sort by rating and color label.

    I can select a rating and a color label for my images, but I can not sort by rating and color label. when I click on the filter drop down, color label is not one of the options.  how do I get both ratings and color lables as an option to sort with.

    You can Filter (not sort) on both color label and rating if you want, open the Filter Bar with the backslash key, then click on Attribute, and then select the stars and color label of interest. If you really meant "sort" and not filter, then you can't do this in Lightroom.

  • Problems importing photos with a color label.

    Hello:
    I'm trying to import photos and assign a color label at the same time. My idea is to know what pics are just imported and put they into "status 0" of my workflow, that is, the pic is just imported and need to be accepted/rejected, then be classified, then made basic corrections, etc, etc. I'm going to change color labels to go from red to green status... a tipical workflow.
    OK, this is what I did:
    Import pics:
    * I select the directory and create/assign a new metadata preset.
    * In this metadata preset I set author/creator and some other IPTC fields.
    * Also I put the word "red" in Label field.
    * Do the import...
    What I can see then:
    The photos are imported and the red label is visible. You can see the red label in the grid view (at every photo's bottom) and also, at the bottom toolbar, you can see that the red label is checked. If you click at the small label at the photo's bottom you can see the small menu with the red label checked.
    OK, it seems that the color label is imported but...
    In the filmstring, if you filter to see only the red labeled pics... nothing is selected !! You have to unassign and assign again the red label and this time you can filter by color label.
    What is happening ? Does Lightroom read the color label from two different fields from the metadata ? Is something not synched during the import process ?
    Regards,
    Javier.

    Sorry if I couldn't explain correctly. English is not my main language...
    I know you can assign names to the existing colors label and create different sets. I just create my own set.
    What I'm refering to is to the Label field that is part of the basic IPTC data into a metadata preset. I'm not sure if it's the same field that is used to assign color labels.
    What I did was to create a metadata preset, assign the word "red" as the value of the IPTC Label field and then apply this preset into an import. All the pics were imported with the red label set, so yes, it is possible to do the import and set the color label. The problem is that you can't use the filters that are into the filmstring view. So there is some mismatch here: the red color is shown at the bottom of the pics imported, but the filmstring filters can't "see" that the pics have this color label assigned.

  • Recursively removing color labels in one go?

    Does anyone know a way to recursively remove color labels within a massive folder? Deep, deep nests exist in there and descending up and down the tree could take forever. Is there a way to select the top level folder and make all files and folders that have been color labelled to be reset to no color? The only way I have of doing it right now is to Find by label color, then select all files, then remove color, then move on to the next color....
    Message was edited by: Maxplanar

    Open the AppleScript Editor in the /Applications/Utilities/ folder, select the folder in the Finder, and run:
    tell application "Finder"
    set label index of every item of entire contents of (selection as alias) to 0
    end tell
    (47274)

  • Color label setting problems in Develop module

    Today is the first day with Lightroom 3, where I have over 200 photos from an event, that I am walking through each photo.  I am in the develop module and I am setting the color label to red or blue.  What seems to be constantly (not every time) happening is when I click the color for the label, LR will move to the next photo, but not apply the color label.
    As I write this I'm trying it out to notice a pattern.  What I see is photo 1, I click on the red label and the photo is labeled red and LR moves to photo 2.  I click on the red label and LR does not set any color label and moves to photo 3.
    Another thing that happened is I was then at photo 3 and clicked on the blue label.  LR did not set the blue label but jumped to photo 4 and put the blue label on that photo.
    This is very annoying.
    Where might I report this bug to Adobe?

    Same bug as with ratings. http://forums.adobe.com/thread/679696?tstart=0
    Flagging via the toolbar, also shows this problem.
    As noted above, use keyboard shortcuts.

  • Importing color labels

    Okay, I'm new to Lightroom so be gentle.  The problem I have is I have about a dozen folders on an external hard drive with files in them that I want to import to Lightroom (I'm on a Mac OS X).  I had previously gone through and put color labels on all of the files but when I import them into Lightroom the color label does not translate.  Is there anyway to include the color label and have it translate to Lightroom's color labeling? 

    UNfortunnately, Lr does can't handle the colour labels applied via Finder (Mac OS X) or Explorer (Windows).

  • Lightroom color labels lost on transition from one pc to another

    I started using a mac laptop in the field and always used windows pc at home. A portable hard drive holds the lightroom catalog. It's fat32 formatted so it can be used by both mac and windows.
    A catalog made by the mac lightroom opens fine in windows. However, all the color labels are lost. The flags and stars are retained.
    If a color label is changed on a photo by the windows version of lightroom, then when that catalog is opened on the mac, that photo has no color label. (even though the mac originally gave it a color label)
    And all the original color labels that were made by the mac magically return as they were assigned.
    To trouble shoot this, I installed the Lightroom 3.6 trial on 2 other pcs - one runs windows 7 32 bit and the other windows 7 64 bit. These installs see the mac created catalog properly.
    All the color labels are there and changing one on a windows box is properly reflected on the mac when that catalog is opened.
    This is so annoying.
    My main pc must have an allergy to my mac.
    I removed and reinstalled lightroom on my pc-same problem.
    Now i have to figure out what is interfering with my main pc lightroom install.
    It cant be lightroom cause i removed it and reinstalled it. but it might be one of the plug ins i use. these magically reappearred even after i reinstalled lightroom after removing it.
    Anyone have suggestions?

    The color labels are preserved between different programs (for instance between Bridge and Lightroom) and I imagine between different LRs on two different computers only when the texts entered as description for the color labels in >Metadata >Color Label Set >Edit is absolutely identical on both computers down to upper / lower case, spaces, numbers, hyphens, etc. If one dexcription for - lets say the red label - deviates from the other by only a semicolon the label will not display properly.
    WW

Maybe you are looking for

  • Duplicate Semantic Key in Write Optimized DSO

    Gurus Duplicate semantic keys have a unique index KEY in the key fields of the DSO when WRITE OPTIMIZED DSO is used. (Of course this is assuming the Do not check uniqueness of data indicator is not checked..) See help https://help.sap.com/saphelp_crm

  • Safari 5.0.6 keeps crashing upon launch

    I no longer can launch Safari anymore.  It opens, hangs, goes to my home page (Google.com) and then promptly shuts down. Here is the problem report.  Any suggestions?  Thanks, Process:         Safari [141] Path:            /Applications/Safari.app/Co

  • Delete holded record in Integration Server

    Hi I had problem regarding to delete / resend record from e.g. Integrations server. The record had status HOLDED and Engine = Adapter Engine All record is send with option "Exactly Once In Order" I had make a clean up for the same kind of record with

  • Rapid Demo Creation

    Hi, if I want to quickly create a demo from an excel spreadsheet is there anyway to shortcut the process, in a similar way that (for example) you can convert a spreadsheet into XML and use that to model in OBIEE? thanks, Robert.

  • Systemd + pulseaudio

    Several months ago I installed pulseaudio and it worked fine at first glance. Then I discovered that when there multiple users active, sound is only available to first user who captured soundcard:). After I read www.freedesktop.org/wiki/Software/Puls