Pass input to Automator's "Ask for Finder Items"

Hi,
I have created an Applescript in Automator, which is  set up to determine a folder location where config files reside.
I would like to pass this location to "Ask for Finder Items", so that the default config file is selected, but the user can select their own config file if they prefer.
I can't see any way to reference my location variable in the "Ask for Finder Items" action.
I've also tried to view the "Ask for Finder Items" sourcecode for a hint, but can't figure out how to do this either.
Any help greatly would be greatly appreciated!
Thanks,
Dan

Found this approach which is working for me:
set config_file to choose file with prompt "Locate the config file and click OK" default location MYLOCATIONVARIABLE
This opens the finder at the correct folder.

Similar Messages

  • "Ask for Finder Items" Automator action broken?

    OK, I'm pulling my hair out on Automator (again). I'm on OS X Lion 10.7.1.
    Here's what I want to do: I have image files named "something-something (S1).png" and I want to create a copy of each file named "something-something (S2).png" then resize that copy to 50% the size of the original. A perfect choice for Automator, I would have thought.
    So here's the workflow I came up with:
    1. Ask for Finder Items: Type set to Files and Allow Multiple Selection checked.
    2. Duplicate Finder Items: To create a copy, hopefully named "something-something (S1) copy.png".
    3. Rename Finder Items: Set to Replace Text, with Find set to "(S1) copy" and Replace set to "(S2)" (in basename only).
    4. Scale Images: Set to By Percentage 50.
    I would have thought that would have worked. Trouble is, it doesnt even get to first base. When I run the workflow I see the expected choose file dialog, and I choose a test PNG file. Then Automator happily announces that "Ask for Finder Items completed" in the log, and proceeds to sit .. and sit ... and sit. It says it's running, but nothing is happening. No duplicate file action happens, no rename .. nothing. Oh, and yes, I do see the selected filename in the "Results" area for the Ask for Finder Items action.
    What's going on? Any ideas? For a supposedly intuitive tool I find automator inscrutable (and I'm a 30 year seasoned operating system oftware developer).
    TIA,
    --Tim

    FWIW, if you've found a bug, please contact Apple Support folks or (if you have access) use the BugReport tool. 
    (This is a user forum, and the Apple Engineering folks may or may not see any reports that are posted here.)

  • "Run Workflow" action in Automator does not "Ask for Finder Items"

    So I have a workflow called step_1 that does a bunch of stuff . . . in essence, it "Asks for a Finder Item" and then runs some Python shells and then outputs an Applescript format list {'item_1','item_2','item_3'}
    I'm trying to use this workflow in another workflow so I selected "Run Workflow" in Automator and located my original workflow step_1 but when I run it, the process goes straight through the workflow and doesn't "Ask for Finder Items" so i'm sure it doesn't do anything else in the workflow either.  It doesn't give me an error, it just pretty much bypasses everything within the workflow and it's pretty annoying.
    Any idea on how to get my workflow to work using "Run Workflow" ?

    Never tired Run Workflow before so as as a test I rn these two
    and the Ask for Finder items in the called workflow ran OK.
    Note this was run  from Automator. One thing I did see was that the Ask for finder items window did not come to the front and I had to look under my open windows to see it.

  • Ask for Text for Set Spotlight Comments for Finder Items

    I want the text from the "Ask for Text" to go in to the "Set Spotlight Comments for Finder Items" action, but they don't seem to interact.
    Any ideas?

    first you make a new variable using variables tab. then you add the action "set value of variable" right after the action ask for text. drag the variable you made to the variable field of that action. this will set the value of that variable to the output of the previous action.

  • Automator 2.2 "Copy Finder Items" Action Error

    Hello all,
    When I try to create an Automator workflow that finds a type of file (pdf) in a nested folder structure and copies those files to another folder - essentially extracting the pdfs from their nested folders - I get an error message.
    1) I use the "find Finder items" action. I specify the top-level folder and set the kind to "document"
    2) It returns 56 items
    3) I use "copy Finder items" action and specify a new folder
    4) The copy action fails stating that a given file "couldn't be saved in the folder". It does not always error-out on the same file. Changing or creating a new folder doesn't help.
    I have tried this under two user accounts with the same result. I have tried deleting preferences. The same error results.
    Any ideas?
    I am running 10.7.1 on a 15" MacBook Pro, early 2011.

    I was having the same issue.
    I found another solution: instead of copying files, you could move files.
    1) Duplicate your original folder (unless you want to move/extract your files entirely to the new folder) (right click the folder and select duplicate)
    2) Create a new folder as the destiny folder
    3) Open automator and use the following actions (in order) on the workflow
    - Find Finder Itens (browse to your source folder; select "any"; select "extension"; select "end with"; type "pdf") (you can do the same thing with the actions "get specified finder items" combined with "filter finder items")
    - Get Folder Contents (and mark repeat for each subfolder found) (use this action if you have subfolders)
    - Move Finder Itens (browse to your destination folder, that you created previously)
    Now you can delete the duplicated folder.

  • Is there an automated turn of for find my iphone?

    I turn on services location and find my iphone and the next hour I see them off. What happened? Is there an automatic way that turn off these????

    I turn on services location and find my iphone and the next hour I see them off. What happened? Is there an automatic way that turn off these????

  • Automator Filter Finder Items

    A very simple task, which I have attempted to figure out many times over the last few months; but my repeated attempts haven't been successful. This should be easy for someone to resolve…
    I would like to strip out all the files of a certain extension (.txt) from an hierarchy of nested folders, & move them to the Trash. (Told you it was easy!)
    Here's what I think ought to work:
    • Create an Automator Workflow
    • 'Ask for Finder Items' to select the topmost folder
    • 'Get Folder Contents' with 'Repeat for each subfolder found' — (the results successfully include all the relevant files)
    • 'Filter Finder Items': "find files where any of the following are true: file extension is .txt" — (I tried "txt" as well as ".txt")
    • 'Move Finder Items to Trash'.
    The files turn up (alongside loads of other junk) in the 'Get Folder Contents' step, & they are reported in the results; but when I try to filter out everything apart from the .txt files, so that only the .txt files remain, the filter reports no results.
    So the 'Filter Finder Items' action completes with no results, & with a warning that: The action “Move Finder Items to Trash” was not supplied with the required data.
    I think it must be something obvious, but I can't figure it out, & although I've searched extensively online, everyone else with similar problems has other complications which get resolved… so they lose interest just at the point where I think they're going to reveal the solution.

    You need to understand the issues here. Automator was released with 10.4 (Tiger), and many of the core automator actions date from that time.  This introduces forward-compatability problems: things that should work (and maybe did work) in 10.4 might not work as specified in 10.6, depending on if/how the underlying cocoa APIs have changed.  Now, in the best of all possible worlds, Apple would update automator actions with each new upgrade, but it's probably not needed for the bulk of the actions, and Apple may not be aware of problems that do exist with given actions (that depends on whether people filed meaningful bug reports on them).
    Don't be confused by the seeming simplicity of what I did: the Move Finder Items to Trash action probably uses cocoa file system APIs directly, whereas my applescript leverages the developed programmatic underpinnings of the Finder - the Finder has a built-in system for moving files in bulk, whereas the action is obviously moving files one at a time (which is where things are getting congested).
    Filter Finder Items seems to be a simple metadata search (just another use of the spotlight framework, which hasn't changed much since its inception) so I can't see any way in which it would fail.  it is, of course, limited by the same things that spotlight is limited by - it won't find material that's not indexed and may not do exactly what one always expects (e.g., may not recognize an extension as an extension unless the extension belongs to an app registered with the system) but other than that there's very little it can do wrong.  As a general rule, actions that deal only with manipulating automator data (e.g. modifying references passed from one action to the next) won't break.  You'll only see breakage with actions that need to access exterior frameworks that have changed significantly since the actions were created. 
    That's the best answer you're going to get: one can't prove a negative, so there's no way to demonstrate that FFI isn't broken.  it's easy enough to check for a given task, though - just run the workflow you have on a test folder without the deleting action, check the results window, and compare it to the results you expect (which you can gather by eye in a Finder search window, through an applescript, through an app that will report the number of files of given types in a folder…). 

  • "Filter Finder Items" not working properly

    I'm taking my first crack at Automator, and while I've made good progress, one of the built-in actions, "Filter Finder Items", is just not behaving predictably. Basically, I'm doing the following:
    1) Get selected finder items - pulls a selected folder
    2) Set variable - this gives me a variable for the name of the folder we're working with
    3) Create a new folder inside the selected folder
    4) Get folder contents of selected folder
    5) Filter for three different file extensions - here's where my problem starts
    6) Move the filtered files into the new subfolder (though it really seems to be copying, which necessitates the following steps to get rid of the original files)
    7) Get contents of selected folder again
    8) Filter on the same three files extensions - this time it works properly
    9) Move filtered files to Trash
    For some reason, the first filter action doesn't seem to be working at all - if I have 15 files in the selected folder, but only three that match the filter, all 15 will be copied to the new subfolder. The second folder action will then, inexplicably, work exactly as it should and move the proper files to the Trash.
    Does anybody know why this action doesn't want to cooperate? Has anybody else seen something similar?
    Thanks for any hints/help.
    Rick
    Message was edited by: rnb2

    Saving the workflow as an application should be all that is needed, but the first action (the one that gets the items to work with) may not be correct for your usage. If the first action is *Get Selected Finder Items*, unfortunately the selection would be the application itself, since that is what was most recently selected.
    In this case, the application can be dragged onto the Finder's toolbar (where it will work with the current selection), otherwise the first action can be removed and the application used as a droplet (items dropped onto the application are passed to the workflow) or a Finder plugin.
    The first action can also be replaced with an *Ask for Finder Items* action (ignoring input).

  • Copying Finder items into same folder as Action

    I want an Action that can copy Finder items directly into the same folder the Action resides in, i.e. without specifying where or asking the user where.
    Is this possible? All I've been able to create so far is an Action whereby I need to specify the folder or get the user to specify it.

    OK, I am now going to try to teach you to fish
    It might be a little bit easier to visualize if you think of the values passed along in your workflow as a stack of playing cards. Some actions do something with the cards and then just pass them on, some take all of the cards, and others add cards to the stack. The Set Value of Variable action takes the current stack of cards (the results of any previous action(s)), assigns it to a variable that is named whatever you want to name it, and passes the stack on to the next action. The Get Value of Variable gets the value of one of your previously named variables and adds it to the stack. You can also use a previously named variable in input fields of various actions, such as locations to copy to. I'm not sure why you are getting the path to the desktop (unless that is where your workflow application is located), but here are some additional comments for my previously posted workflow:
    1) Run Applescript (with the Applescript posted earlier)
    - if your workflow has been saved as an application, the results of this action will be a path to the folder that it is in (if not, the path will be to where the Automator application is, which isn't what you want)
    2) Set Value of Variable
    - this action will take that path, assign it to a variable with your specified name, and pass it on
    3) New Folder
    - this action makes a folder with the specified name in the specified location - you can drag variables into these fields, in which case their current values are what will be used
    - the result of this action is a new folder, and the path to the folder is added to the current stack of cards (if any) and passed on to the next action
    - since we just want the path to the new folder (and none of the previous cards), first we throw away any cards we may have (with the "ignore input" option) so that our results don't get mixed up.
    4) Set Value of Variable
    - same as (2) above, except that the value is now the path to the folder that got made in the previous action (3)
    5) Ask for Finder Items (Type: files, Allow Multiple Selection)
    - the results of this action will be whatever items you selected, and of course, they will be added to our current stack of cards unless we throw them away first with the "ignore input" option
    6) Copy Finder Items
    - this will copy Finder items (the ones we selected in the previous action) to the location that is specified - you can drag a variable into the To: field, in which case it's current value is what will be used.
    - the result of this action will be the paths to the items that were just copied, but since this is the end of the workflow it doesn't matter
    You can use the View Results action to see what the current stack of cards is, so you can see if what is going in and coming out of your actions is what you expect, and tweak accordingly.

  • Multiple Extension in Filter Finder Items

    Does anyone know how to make Filter Finder Items filter for more than one extension? For example, if I want to make a script filter for MOV, AVI, and WMV?

    Well, it sure would be nice if the filter action would do that for you directly, but since it doesn't there are a few alternatives. You can use a Run AppleScript action to do the filters, a Run Shell Script action to do the filters, or use a bunch of Automator actions that do each of the specific filters and combine the individual results:
    Tested workflow:
    1) Ask for Finder Items (Type: Files, Allow Multiple Selection, Ignore Input)
    2) Set Value of Variable (Variable: Source Items) -- store the original items
    3) Filter Finder Items (Whose: Name Extension is equal to mov)
    4) Set Value of Variable (Variable: MOV items) -- store filtered MOV items
    5) Get Value of Variable (Variable: Source Items, Ignore Input)
    6) Filter Finder Items (Whose: Name Extension is equal to avi)
    7) Set Value of Variable (Variable: AVI items) -- store filtered AVI items
    8) Get Value of Variable (Variable: Source Items, Ignore Input)
    9) Filter Finder Items (Whose: Name Extension is equal to wmv)
    10) Get Value of Variable (Variable: MOV items, Accept Input) -- add the previous filtered items
    11) Get Value of Variable (Variable: AVI items, Accept Input) -- add the previous filtered items
    12) View Results (or continue with the rest of the workflow)
    Note that the Accept/Ignore Input item will let you combine or isolate the action from the results of the previous one.

  • Automator: How to reveal multiple Finder items in 1 Finder window?

    Just as the subject states. How do I use Automator to reveal multiple Finder items in a single Finder window?
    Thanks in advance!

    Allow me to also briefly explain what I'm trying to do. For some reason Spotlight does not index the Library folder by default. I'm trying to create a workflow app which allows me to do this at will.
    So far upon experimenting I can get it to kind of work with the following actions...
    Text > Ask for Text (as in "What would you like to search for in the Library folder?")
    Utilities > Spotlight (executes the search based on the input from the first action)
    Files & Folders > Reveal Finder Items (reveals the results of the search, but in a separate Finder window for each result)
    My goal is to aggregate the results and display them in a single Finder window if possible.
    Thanks

  • Hp pro 8500 keeps asking for maganta ink when it's already a new one, then loose image, please help

    HP PRO8500
    KEEPS ASKING FOR MAGANTA INK, THEN LOOSE IMAGE, I ALREADY REPLACED INK TWICE BUT ISSUE STILL PERSIST.
    PLEASE HELP

    Ok, finally got it fixed !
    Here's what was causing the issue, and what I did to fix it :
    I had free content in my iTunes download queue that I got from the "iTunes 12 days of Christmas" promotion, but the problem was that some of the items (two HD episodes) were too large to fit in my harddrive (I'm running low on free hd space) - so each time I was running iTunes I had to cancel the downloading of those items. On my iPhone, I was able to cancel the downloading once for all, but iTunes somehow wanted to try downloading them even if I deleted them. This was quite frustrating so I sent a mail to the support using the Express Lane feature on the support website, asking for thos items to be removed from my iTunes account - and tadaaaa ! Once a nice guy from Apple deleted them, my iPhone stopped asking for that stupid password !

  • HT4113 My daughters iPod touch asks for her pass code but when she types it in the cursor does not move or input any characters so,she cannot get into the iPod. This has suddenly happened for no apparent reason

    My daughters iPod touch asks for her pass code but when she types it in the cursor does not move or input any characters so,she cannot get into the iPod. This has suddenly happened for no apparent reason, what can we do? Can anyone help please?

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • I have changed my Apple ID n pw , however an old Apple ID pops up asking for the pass word , I can't stop it or get rid of it, or find a pass word that works. Or reset it?

    I Changed my Apple ID and PW they work fine. But the old Apple ID keeps popping up asking for a PW, how can I get rid of the pop up request Or the old Apple ID? This only happens on the iPad.

    Sign out and back into your apple id from Settings>iTunes and App stores>(Your apple ID)>Sign Out and then sign in again with the new address. Close app store from running in the background (or restart the phone if your unsure how to do this). If when trying to update any apps they are still asking for the old apple ID, delete and re-install those apps.

  • How to ask for a number of copies in Finder Print?

    How to ask for a number of copies in Print Finder Items? Thanks.
    iBook G3 700   Mac OS X (10.4.8)   Still running a paperless office on my iBook! 120gig, 640RAM, 1440 x 900 2nd monitor! 500gig FW-HD!

    Here is a script that will create a "Run AppleScript" action in Automater that should do what you want. Just click on the link and hit the Run button in Script Editor.
    I wanted to get this too you fast so there is no error checking on the text entered into the dialog. Let me know if you want it added.
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">
    tell application "Automator"
    make new workflow
    -- Action 1
    add Automator action "Run AppleScript" to workflow 1
    set value of setting 1 of Automator action 1 of workflow 1 to "on run {input, parameters}
    tell application \"Finder\"
    activate
    set theFiles to input
    display dialog \"How many copies do you want\" default answer \"1\"
    set NumberOfCopies to text returned of the result as integer
    end tell
    repeat with aFile in theFiles
    repeat with j from 1 to NumberOfCopies
    tell application \"Finder\" to display dialog \"Printing copy \" & j & return & aFile giving up after 2
    tell application \"Finder\" to print aFile
    end repeat
    end repeat
    return input
    end run"
    end tell</pre>
    PowerBook 12"   Mac OS X (10.4.8)  

Maybe you are looking for

  • Creation of DME medium FZ205 There is no source data found

    We are executing payment runs using F110 and then creating data medium - a file to send to the bank. In the variant for the program I am putting C:\ however when I have several users executing payment runs at the same time, the data medium is not cre

  • Back up iPhone to PC using iTunes

    I have iPhone 5s and try to sync/ back up to my window Xp using iTunes, but when I connected to iTunes. It's shows a 'welcome to your new iPhone' instead of my iPhone's summary with my name and series no. appear. I only have two options 1. Set up a n

  • Newbie question concerning java chat

    Hi everyone, I'm going to program at chat-service in java at school. Since I'm still rather new at this game, I was wondering if anyone knew any good tutorials to start with. I'm also very interested in recommendations as to which java techniques wou

  • FileMerge needs horizontal scroll

    The Developer tool FileMerge is the best visual diff I've seen so far. It actually shows you want is different on the line not just highlight the whole line. However, I can't scroll to the right and see the rest of my file. Workaround: I turned on wo

  • My mac os x 10.5.8 is coming so slow, my harddisk kapazite is 140 GB, and free is 85 GB. Why is slow or what can i do?

    hi my mac book is so slow, or coming slow. 85 GB is free HD, from 145 HD. can sombody help me? thanks Vijay rom Switzerland