Search Finder Tags with Applescript?

Hi I am trying to write a little script that will change my wallpaper based on the images Tag.
I was wondering how do I access the Finder Tag parameter in Applescript?

In its most simple form, the following will find an image file in your home directory tree, assign it to a variable, and then use System Events to set the desktop picture. Takes about a second. If you have multiple images with the same tag name, then you will need to use a choose from list using the imgName to prompt you to make a choice, and send the result to System Events.
set myTag to "Work"
tell application "Finder"
  set imgPath to do shell script "mdfind -name 'kMDItemUserTags == \"" & myTag & "\"cdw'"
end tell
tell application "System Events"
  tell current desktop
  --get picture
  set picture to imgName
  end tell
end tell

Similar Messages

  • Use Finder Tags with multiple computers

    How do we keep Finder Tag names in sync for files saved in Dropbox or iCloud?
    After I can add tags to files in my rMBP and assign colours to them, these files are kept in sync with my iMac through Dropbox.
    In my iMac, while the new colours are reflected in the same files, the Tag names are not.
    Is this how its supposed to work?

    To seems problem to be the effect of you rename the defult Finder tags (the ones replacing Finder labels) instead of making new ones.
    So this made the trick for me:
    1. Created completely new tags whith the names I wanted
    2. Gave the new tags colors
    3. In Finder settings, removed the default tags from the sidebar and the contextual menu, putting the new ones in their place.
    Then at least tagnames - and colors and sidebar settings – was synced via iCloud and Dropbox. I think this will be the case for server volumes as well.

  • Search / Find problem with Mac Notes

    The 'command f' function is greyed out on my new version of 'Mac Notes' that comes with Lion. As per the image below. why can't i use that 'Find' function?
    There is another search function in Notes
    but this just does a broad brush search to see if any of my notes contain a word and identifes the title of the notes but it doesn't identify where the words are within the note. i have some notes with thousands of words so this isn't very helpful.
    does anyone know how i can use the traditional 'Find' function in Notes? or perhaps some free software that i can use instead of notes?
    why they changed it i don't know? i've been using mac for 13 years and some things are just getting less useful and intuitive. 
    Thanks
    Shane

    I agree.   Still no resolution to this problem and the integration of icloud makes looking at alternatives less appealing. 

  • Finding images with keyword tags in PE 12 Organizer

    I am experiencing difficulties while finding images with keyword tags.
    I am using the Organizer of Photoshop Element 12 (French version) and I think I follow the procedure described in “ADOBE ELEMENTS ORGANIZER Help and tutorials” (page 168 in the English version or alternatively 150 in the French one), i.e. :
    In the Keyword Tags panel, I click the ">" symbol of the keyword of which I want to know the relevant images
    Whatever the search option (Select either Hide Best Match Results Show/Hide Close Match Results, or Show/Hide Results That Do Not Match), I am not able to select and show only the Best Match Results.
    Please note also that the Tip
    To automatically display close matches after a search, choose Edit > Preferences > General, or Adobe Elements Organizer 11 > Preferences > General, and select Show Closely Matching Sets For Searches, and then click OK.
    does not seem to work with Adobe Elements Organizer 12

    Thks
    You are right, my problem is to select only the close matches.
    Based on your comment, I am afraid it’s one of the recurring problem in PE whatever the version (PE11 or PE12)
    De : MichelBParis 
    Envoyé : vendredi 30 mai 2014 08:40
    À : Michel ROUSSEAU
    Objet :  Finding images with keyword tags in PE 12 Organizer
    Finding images with keyword tags in PE 12 Organizer
    created by MichelBParis <https://forums.adobe.com/people/MichelBParis>  in Photoshop Elements - View the full discussion <https://forums.adobe.com/message/6420729#6420729>

  • What is the best way to search for tags in Finder?

    There are a lot of articles out there written about Tags in Mavs. All of them cover how to apply tags, but there is hardly anything written about searching and finding files.
    Now, does anyone here actually use tags in Finder? How do you search for them? Did anyone ditch folders or stytematic file-naming?

    I am currently using and experimenting with Tags. Searching, finding, and managing your tags is pretty straight forward. On the far left side of any Finder window, you have a selected number of Tags predetermined and an option for "all tags." If you click on this link, it will take you to a menu where ALL tags in use are listed. Change the name and color for them just as you would any other file name (I have a usb mouse, so it's a right click for me).
    If you used the "labels" feature (color-coding documents and folders), you have used tags; its the same idea, but now you define a word as what you are sorting by.
    To search for a tag, I either use the in-Finder search or Spotlight (which may be the same, but I am not sure--I am also a newer Mac convert and am still learning the ropes). I have started to organize my schoolwork solely by tagging it, but I have run into issues where I have "Exam 01" for one class and need to make a second "Exam 01" file for another class (I created different tags for each class).
    I will say that, since I started to only use the minimum amount of folders, I have noticed somewhat significant speed improvements in startup times and normal use. However, this coincided with the release of Mavericks so I do not know truly whether the folders help or not.
    One of the things I both love and hate about tags is that you can search across multiple folders (or drives in my case) for documents matching the tag in question. When I download classwork from our school's website, I tag with the appropriate class name, and then move to external hard drive (yeah, I am paranoid). Unfortunately, if I then don't delete the copy inside the "downloads" folder, the document will show up if I try to list all of my "Class" tags.
    Best of luck,
    ~Zach

  • Find images with parent keyword tag only?

    I don't know how to describe this problem succinctly, so I don't know how to search for it in the knowledgebase or forums. Can anybody help?
    I want a keyword hierarchy with "US" as parent keyword of 50 states name keywords. I have many images with state keywords, but I also have some images that are tagged only with "US" but no state tag, as they are not specific to a state.
    How do I *easily* find only the images tagged "US" but with no state tags? Clicking on "US" in the keyword panel shows me all images tagged with "US" and all with state tags, but I just want the ones tagged "US".
    I can use "Find" to find "US" images NOT CONTAINING "AL AK AR AS AZ..." by enumerating all 50 states, but that's a terribly awkward way filter out images tagged with state names. I can't see a button or filter that shows only the images with a parent tag but without child tags
    Any ideas?
    Thanks ahead of time,
    Dave

    John, this seemed like a great idea.  I tried it, and it seemed to work.  There was an immediate problem because when there are lots of keywords it means a lot of scrolling and it can be hard to locate rail among rain rate rails etc. because the font is so small.  A second problem was that you are forced to mouse scroll - cant page down or up or use home or end. That can be a lot of scrolling. a third problem is that it seems you have to reselect flat view each time.
    a more serious problem is that it seems to have stopped working.  I'm not quite sure what i did but i have a keyword verb with 5 items and about 1125 child keywords (such as to sing to run etc.) for 1125 photos   i click on the verb arrow in the keywords so i bring up 1125 pictures of verbs.  now i go to metadata switch to flat view.  i can now see "verb" as a keyword in the metadata panel, but when i click on it, nothing happens - I still have 1125 selected photos.  Furthermore i cannot click on any other keyword in the metadata panel - that is nothing happens when i click.  if I return it to hierarchical view it is fine.  then Lightroom 4 64-bit stopped working.  when i restarted the program it was still in flat view and i was now able to click on the metadata panel and see appropriate collections.  then it stopped working again after i clicked on the keyword panel (but did not actually select anything).  in total i have about 3000 keywords and about 100000 photos on local and network drives.  it looks to me like flat view has some serious problems, but perhaps its something i am doing.... 
    i also have to say that even if it worked perfectly, i still might prefer other solutions because scrolling up and down for 3000 keywords can be tedious - its difficult to prevent overshooting and undershooting the mark.  if the keyword and metadata panels could be undocked that would probably be a big help.

  • Search and replace formulas with AppleScript

    Thanks to this forum I've found out that it is possible to search and replace text by other text or formulas with AppleScript in Numbers 3.2
    Does anybody have a script to search and replace a formula or a part of a formula by another formula or a partial formula.
    For example:
    I would like to be able to find:
    = Table1::$b$3
    and replace this by:
    = Table1::$b$4

    De Signature,
    Would this approach work for you...
    This is a very neat way edit a complex formula in a single cell....
    a) Copy and Paste the formula to a new black page in Pages,
    b) Do your Find and Replace, then
    c) Copy and Paste the formulae back into the cell in Numbers.
    It works like a charm.
    Here is an example of how I used this approach...
    Original cell formulae:
    =AVERAGE(
    SMALL(OFFSET(K3,1,0,20,1),1),SMALL(OFFSET(K3,1,0,20,1),2),
    SMALL(OFFSET(K3,1,0,20,1),3),SMALL(OFFSET(K3,1,0,20,1),4),
    SMALL(OFFSET(K3,1,0,20,1),5),SMALL(OFFSET(K3,1,0,20,1),6),
    SMALL(OFFSET(K3,1,0,20,1),7),SMALL(OFFSET(K3,1,0,20,1),8))
    Final version of formulae:
    =AVERAGE(
    SMALL(OFFSET(K3,N1,0,20,1),1),SMALL(OFFSET(K3,N1,0,20,1),2),
    SMALL(OFFSET(K3,N1,0,20,1),3),SMALL(OFFSET(K3,N1,0,20,1),4),
    SMALL(OFFSET(K3,N1,0,20,1),5),SMALL(OFFSET(K3,N1,0,20,1),6),
    SMALL(OFFSET(K3,N1,0,20,1),7),SMALL(OFFSET(K3,N1,0,20,1),8))
    Find Replace: be cautious with the Find, to ensure it is unique, in my this example ",1,", to avoid changing the" ,1)"
    Enjoy...

  • Why can't I find events with cmd-F? I can see the appointment I am searching for, but the search cmd-F function does not find it. Why is this. It used to work...

    Why can't I find events with cmd-F? I can see the appointment I am searching for, but the search cmd-F function does not find it. Why is this. It used to work...

    Why can't I find events with cmd-F? I can see the appointment I am searching for, but the search cmd-F function does not find it. Why is this. It used to work...

  • Adobe PostScript 3 problem with 'search' & 'find'?

    We have a new Ricoh copier with Adobe PostScript 3 installed. When we scan a document as a .pdf and send it to an email address, the receiver gets it, opens it ok, but then can't 'search' or find' or copy anywhere on the document.  What is the problem?  Is it the Adobe PostScript 3 software? 
    Please help, as we need to get these documents to 'search', 'find,' and  copy.
    carol forbes, j.d.

    Yes, we know now that the .pdf is a picture image, but how do we correct it?  We've been told it needs OCR (optical Character Recognition), but isn't that included in the software of Adobe PostScript 3?  Please advise.
    Thanks, Carol
    Duval County Law Library
    501 West Adams Street, Rm 2291
    Jacksonville, FL 32202
    Ph:  (904) 255-1150
    Fax: (904) 255-1164

  • Corrupted files with automatic red finder tags! :(

    Hello,
    it's for some time that my mac corrupts files, particularly those videos stored on various hard disk randomly. Each file has a red finder tags and I am not able to open them though I see it size that seems ok...I tried to check hard disk but this not solve problems...
    Sorry for my bad english...
    https://www.dropbox.com/s/qmxoqq650cg09cp/box.jpg?dl=0
    Any suggestions?
    Thanks

    I have today encountered a problem opening old Keynote presentations on my new iMac running Leopard. It cannot open any of the old presentations on my machine because it says they are damaged.
    I also could not open an old Pages file because it says the file is corrupt and there was a .xml missing. I later managed to open this by searching for it directly through the application "Open" command and following the search path. It then gave the usual " This was created by a previous version of Pages..." and the Save as warning, but it did open when I went this route. (I have now saved this document as Pages 08 and all is well).
    There seems to be a bug in the iWork '08 suite when it comes to older documents.

  • Spotlight fails to find files with search items

    I just did a Spotlight search on
    Japanese English は
    Spotlight found more than 3500 items, but the two sample Word files I looked at didn't have は in them.
    This is really frustrating. Is there a way to ensure Spotlight only finds files with the input?

    Spotlight is notorious for its weaknesses and erratic behavior. You might try reindexing your Spotlight. Open up Spotlight in Sys Prefs, go to Privacy and drag the HD Folder there. Leave it a minute then remove it by clicking on the minus at the bottom. This will force Spotlight to reindex the drive, which may take some time.
    I mostly use EasyFind (free) instead of Spotlight.
    http://www.devon-technologies.com/products/freeware/

  • Find text Between tags with a Regular Expression

    I am trying to find specif text -- table names - within a
    <cfquery> tag in all my cfm files. I am using an extend find
    function in Homesite (I think Dreamweaver has the same
    functionality). This expression works:
    <[Cc][fF][qQ][uU][eE][rR][Yy]
    [^>]*>[^>]*(EventName|AttendeeName)[^>]*</[Cc][fF][qQ][uU][eE][rR][Yy]>
    for find the text EventName or AttendeeName. However, if
    there are other cf tags like <cfif> within the
    <cfquery>, then the tag/text is not found.
    Can anyone help? It is a useful expression to have if you are
    trying to transfer applications developed on a windows machine to
    a, say, linux machine, and have table name sensititvity issues with
    mySql.

    quote:
    Originally posted by:
    Newsgroup User
    Thanks for all the help. Comments below.
    > Thanks, but it:
    > 1) Captures everything between the first and last query
    in a script if there
    > is more than one cfquery in the script
    Oops: sorry. Stick a question mark after the asterisks to
    stop the matches
    being greedy.
    Used this:
    <[Cc][fF][qQ][uU][eE][rR][Yy].*?(EventName|AttendeeName)[^>].*?</[Cc][fF][qQ][uU][eE][rR][ Yy]>
    and got some finds again with multiple queries and some
    errors as mentioned below.
    > 2) It produces some regular expression errors in
    Homesite.
    Can't help you there. Sounds like HS's regex processor is
    bung: there's
    nothing non-standard or tricky about that regex (which might
    cause
    compatibility issues; JS vs PERL vs Java, etc).
    HS on the whole is bung (IMO). Have you considered using a
    text editor
    that is... err... *current*? ;-)
    No, can you suggest one. Just use HS for years and it does
    most of what I want.
    What sort of errors is it giving?
    Regular expression error No 17. Bad expression format or
    internal error.
    > The reason for this is I am developing on a windows
    machine with mysql and
    > want to use the application online on a linux machine
    where table names are
    > case sensitive. My code was not always faithful to that
    since in windows you
    > can be sloppy!
    Have you seen this:
    http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
    It might be a better approach anyhow.
    Adam

  • Where can I find "Getting Started with AppleScript"?

    I googled it. And it doesn't show any links from Apple. I'm trying to learn AppleScript and the Language guide says to go through the Overview first which in turn recommends going through Getting Started with AppleScript.
    I even searched Mac Reference Library but it just doesn't show up!
    Any help?
    Neerav

    No, certainly not. I mean, I don't know any AppleScript, but I can say with certainty that the answer to that question is no.
    Objective-C is a programming language that is an extension of the C language. It is the language that is used to develop applications for Mac and iPhone. Other languages like C++ and Java can be used as well, but Objective-C is the language that Apple really intends for you to use for Mac and iPhone development, since it is heavily integrated with the Cocoa framework (for Mac developemt) and Cocoa Touch framework (for iPhone development). You need to know the C language to learn the Objective-C language, and you need to know the Objective-C language to work with the Cocoa or Cocoa Touch frameworks, but AppleScript is a totally separate and different animal from these things. AppleScript is a scripting language, and although it can technically be used to create applications from what I understand, it is mainly used as a mechanism for controlling applications. For example, you could use AppleScript to tell a certain application to perform a certain task everyday at a certain time. You can use it to create automated workflows and whatnot. I think that's what it's mainly meant for.
    It's worth noting, however, taht there is a development environment called AppleScriptObjC. I don't really know anything about this, except that it allows for AppleScript to be used as the primary programming language.
    I found a lot of this information at [Wikipedia's AppleScript page|http://en.wikipedia.org/wiki/AppleScript], so you might want to consider looking over it real quick -- it might be helpful. Here is the link to [Wikipedia's Objective-C page|http://en.wikipedia.org/wiki/Objective-c] and [Wikipedia's Cocoa page|http://en.wikipedia.org/wiki/Cocoa_%28API%29]. As someone said on these forums, Wikipedia is far from the last word on any subject, but those links might be helpful for you for just getting an idea of what these things are all about.
    Hope that helps some. Please let us know if you have any other questions.

  • How to find photos tagged with "5 Star" in the current album

    I have just migrated a large library from Aperture, I can see and use the star tags "5 Star", "4 Star", "3 Star", etc. However, I do not seem to be able to search for photos with these tags localised to the current album that I am viewing.
    For example, I have an album iPhoto Events > 2015-04 where I have imported photos from this month. I have tagged all the photos as I normally do in Aperture including "5 Star" tag. Now I want to see all the photos with "5 Star" and share them onto iCloud Photo Sharing. If I type "5 Star" in the search box, it shows me all the thousands of photos with this tag!

    I guess that since the search function is not as powerful as Aperture's this will have to do until they add back all the functions from the old programs. I will try to do a last 30 days + 5 Star album for the time being. Thank you for your suggestion

  • Problem with Search / Find in Files ... in Version 10.1.3.1.0?

    When i use the function Search / Find in Files ... about the Active Application the IDE will be frozen and the JDeveloper hangs and must be killed. Is this a bug or is this only my problem?

    I had a similar problem a while ago.
    It would hang on 'indexing...'
    I think the problem was that i had a package that was called exactly the same as my project.
    For example:
    Projectname: util
    Package: com.example.util
    The problem disappeared when i renamed the project.
    I never came around checking if that was the real problem tough, so i could be completly wrong.
    Regards

Maybe you are looking for

  • Reading Data from serial (Comm) Port in developer200 forms 6i

    Dears, I have developed an application using Dev2k forms 6i. I need to read data from a device (weigh bridge) that is attached to PC on comm port. scenario: when a vehicle comes on the Weigh bridge it calculates its weight and send it to the PC on se

  • How to send records to the MDM workflow using Java APIs

    Hi All,     Using Java APIs i want to send group/single records to the backend MDM workflows for further processing. Can this be acheived? Please provide me with some code samples if you have any Regards Suresh

  • Notes app saves new version with every edit?

    This is odd. In the new notes app every time I edit a note (or even while I am creating it...virtually every time I hit return) a new version of the note gets save. Typing a short note gets 15 versions in the sidebar (like the enclosed pic) Is this h

  • The actual query being executed

    hi all, is there a way to log the actual sql query being executed i saw that there is trace option for sql query but it is not logging anything can anybody help me please regards, ramakrishna

  • Can I restore imac to earlier time if I never set up time machine?

    I was downloading files for Photoshop cs6.  Long story short...photos are not stored where they were stored prior to the download.  I need to reset the imac to a point before that.  I did not have Time Machine set up.  Thanks