Using Variables to Open Finder Item

I have created a workflow that right now goes through the following actions:
1. Get Specified Finder Items
2. Open Finder Items (using TextEdit)
3. Watch Me Do (To Select All..Copy...Close Text Edit...Click in text input field of Safari...Paste)
What I would like to do is use some variables to determine what TextEdit File is opened. For example, I would have a text file named "Friday-FileA.rtf" and would like to have the workflow use the variable to determine what Weekday it is and open the appropriate file.
I am new to Automator and have no knowledge of AppleScript but am pretty competent with my mac. Please let me know if this is something that can be done rather easily.
Thanks in advance
Nick

say you have a file "friday-13.txt" on your desktop.
You can modify your workflow by changing the first action "get specified finder items" to:
1. get value of variable "current weekday".
2. run apple script action:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
on run {input, parameters}
tell application "Finder"
set wday to file (input & "-13.txt" as text) of (path to desktop)
end tell
return wday
end run</pre>
You can modify that as needed.

Similar Messages

  • Open finder items automator

    Hi,
    I have an automator service that uses Open Finder Items as part of the workflow.  This works fine except if the app I want to use is not in my Applications folder.  How can I make it so that my workflow can find my app in any location I keep it?  I see the option New Variable but didn't quite figure out how to use it.  I was also thinking to maybe use Applescript as part of my workflow but again couldn't figure it out.  Any help would be great I'm sure there must be a way.  Thanks!
    rc

    I'm having a similar problem. When running from within Automator everything is fin, but the plug in doesn't get the finder items. Oddly, I have ONE old workflow that takes the word "folder" away from a file name. That one works fine, but doesn't require any action once I select it. It doesn't even open the automator show action dialog window to make any changes. Weird how this one is still working and the other ones won't.

  • Automator Open Finder Items Won't Work in Plug-In

    I'm having another Automator problem in Leopard.
    This time I have a workflow that is intended to combine PDFs selected in Finder and open the resulting document in Preview. The steps are:
    1. Get Selected Items
    2. Combine PDF Pages, Combine by appending pages
    3. Open Finder Items, Open with Preview
    The workflow runs fine if I'm running it from within Automator. When I save it as a plug-in, the Open Finder Items portion doesn't work. If I turn on Show this Action, I get a dialog box with a dropdown list of programs with Preview already selected along with Cancel and Continue buttons. Clicking the Continue button does nothing.
    As a test, I tried removing the Combine PDF Pages step from the workflow and saving it as a plug-in. My expectation is that this version would simply open the items selected in Finder. Unfortunately, that didn't work either.
    Anyone have a clue for me?

    I'm having a similar problem. When running from within Automator everything is fin, but the plug in doesn't get the finder items. Oddly, I have ONE old workflow that takes the word "folder" away from a file name. That one works fine, but doesn't require any action once I select it. It doesn't even open the automator show action dialog window to make any changes. Weird how this one is still working and the other ones won't.

  • Automator (move finder items)

    I have a service that moves finder items to a particular folder. Since I started using this I noticed I occasionally will need to move an item with the same name into this folder. Is there a way I can get the service to move the second item with the same name, but instead of overwriting the first item, have it add a -1 or something? If I open something like a zip file multiple times in finder, it creates the second one with a 1 after the name. That's exactly what I need. Any way to do that with a service like this?

    No, I didn't give up on the thread, I just went to work with what you gave me to see what I could do with it. It's just that you've been nothing but extremely helpful and patient with me in the past; and I started to feel like I was coming to the board, putting up my problems, and you do everything for me. I know you're here to contribute to the community, but I don't like to take advantage. I am making an effort to learn this stuff now, I just have to make baby steps!
    Okay, here is the deal with this item. I actually want to apply this with more than one operation, but the basic script or concept would remain pretty much the same. We create lots of documents like invoices, receipts, shipping labels, etc., that usually get saved as pdf onto the desktop. Then, they are named, often with the date and particular file name and finally moved into the proper folders. For example, shipping labels get saved to desktop with the default name of something like
    vty3RlsIK.LabelGenerationServlet.part
    Then I would change the name to something like
    12-31-2009USPSLabel.pdf
    Then, I would move it to the folder where we keep the shipping labels for records.
    So, the service I created actually does more than just moving the file. It goes like this:
    service receives selected pdf
    in finder
    name single item in finder item names (to: USPS_Label.pdf)
    add date or time to finder item names (before name, underscore separator)
    move finder items (to target folder)
    open finder item (with default application)
    The other ones I need would be similar, except they don't usually need to be opened afterward, just named and moved, for the most part. I figured I could continue to just use the name change function of automator before running the script, but if would run faster or more efficiently if that were also part of the script, I suppose that would be better. And I would like to be able to have the numbers go up through as many as I need. If it's a matter of just adding in all the possibilities of existing names up to the number I need, that's tedious work I don't mind doing now to save on having to name all these files in the future!
    Also, these files are always named differently, so the source file would need to just be selected file, not the actual name.
    Finally, I tried to play with the script to name the desktop like you said, but would it be something like
    set source_folder to folder (path to desktop)
    or
    set source_folder to (path to desktop)
    I still need to learn a little more before I understand the way that works. I am so used to only using the unix path, I like the ability to use (path to desktop) that's really interesting.
    I think I may have rambled a bit, but that should explain the details of what I'm trying to accomplish.
    thanks

  • AppleScript for entering text in Open Finder Window

    I am very, very new to using AppleScripts. I need to enter text into the search box. So far the script looks like this:
    on run {input, parameters}
        tell application "myApplication" to activate
        tell application "System Events"
            keystroke "o" using {command down}
        end tell
        return input
    end run
    This launches the app and fires the command-o keyboard shortcut to open the finder menu to choose a file to open. Now I just need to enter text in:

    happyg5_89 wrote:
    Well, honestly I am processing a bunch of pictures in automator. At the end of the workflow I am launching this application and I am trying to navigate to a folder of pictures on the desktop and then hit the Open button...
    I'm not sure what the above means.  are you trying to open a Folder containing image files in the Finder, or are you trying to open a set of image files in some application?  If the latter (which seems more likely), just add and Open Finder Items action at the end of the script and specify the application you want to use to open them.  Or if that's not what you mean, could you explain a bit more clearly?

  • OPEN LINE ITEM not activated in GL

    If you are in ECC 6.00 you need to use T.Code FAGL_ACTIVATE_OP provided you are in EHP3 is used to Activate Open line item.
    Does anybody have an idea if  We are In  ECC 6.00 , EHP2 What is the procedure to Activate Open Line item in GL.
    Please let me know the detail process

    Hi,
    If your query which i understood is correct, you want to activate an existing GL account for Open Item Management for which already there were some transactions happened and there is a balance. 
    With a balance in the GL its not recommended to switch on open item management.  You can transfer the balance to a temporary account, make the GL to 0 and then you can change. 
    Thanks,
    Krish.

  • Filter finder Items... broken? (also request to help streamline script)

    Let me begin by saying that I've done the SAME THING for a long time with this Automator script, and it's worked flawlessly. I recently added some now automator actions (and later deleted them) thinking they were the culprit of why my "filter finder items" was showing no results, but I'm not sure at all at this point.
    Here's the script (that has been working fine until at least the 7th):
    It's long, so bear with me (I use this script to install custom Sims2 content when I download it:
    ("Get Specified Folder" uses the "Get specified finder items" action, I just didn't want to type that every time).
    New Folder: Recent (in my downloads folder)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains .package)
    Copy Finder items (to Recent)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains Sims2Pack)
    Move finder itmes (to my core download folder (they're generally in subfolders after downloading, as are the .package files)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains Sims2Pack)
    Copy finder items (to Recent)
    Get Specified Folder: Recent
    Create Archive (on desktop named Sims2)
    Rename (add date to end of file name)
    Rename (add time to end of file name)
    Get Specified Folder: Recent
    Move to trash
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains .package)
    Move finder items (to Sims2 Downloads folder, which installs the custom content, replacing any repeats)
    Get Specified Folder: my downloads folder
    Get folder contents
    Filter finder items (name contains Sims2Pack)
    Move Finder items (Sims 2 Packs folder within the downloads folder... these items must be installed into the game by double-clicking on them.)
    Get Specified folder: Desktop
    Get folder contents
    Filter finder items (name contains Sims2)
    Move Finder items (To Backup)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains MTS (most of the containing download folders (after they've been expanded by another automator script, have this at the beginning of the folder name due to where I commonly download my custom content)
    Move to trash
    And that concludes the script. I know it could probably be streamlined (another reason I'm posting the whole thing) but it worked until very recently, and I don't know what could cause it to no longer report results after filtering within the subfolders while within the main folder works fine.
    To clarify, it's recently been simply deleting the MTS folders and creating a "Recent" folder and archiving it but it's empty. So the script is not filtering for the Sims2Pack data nor the .package data as it used to.
    I haven't modified the script, and I've deleted all actions that I downloaded recently (backed them up in case they're not the culprit). Also ran disk permission repair but nothing was repaired in regards to Automator.
    Thanks.
    iMac Intel   Mac OS X (10.4.7)  

    Here is an update to the script, however filter continue to not work as it once did.
    New Folder: Recent (in my downloads folder)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains .package)
    Copy Finder items (to Recent)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains Sims2Pack)
    Move finder itmes (to my core download folder (they're generally in subfolders after downloading, as are the .package files)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains Sims2Pack)
    Copy finder items (to Recent)
    Get Specified Folder: Recent
    Create Archive (on in "to backup" named Sims2)
    Rename (add date to end of file name)
    Rename (add time to end of file name)
    Get Specified Folder: Recent
    Move to trash
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains .package)
    Move finder items (to Sims2 Downloads folder, which installs the custom content, replacing any repeats)
    Get Specified Folder: my downloads folder
    Get folder contents
    Filter finder items (name contains Sims2Pack)
    Move Finder items (Sims 2 Packs folder within the downloads folder... these items must be installed into the game by double-clicking on them.)
    Get Specified Folder: my downloads folder
    Get folder contents (repeat for each subfolder found)
    Filter finder items (name contains MTS (most of the containing download folders (after they've been expanded by another automator script, have this at the beginning of the folder name due to where I commonly download my custom content)
    Move to trash
    I removed the step where it was saving it to the desktop. If the filters ever work again, this should therefore go faster than before.

  • RENAME FINDER ITEMS

    - I am using the function RENAME FINDER ITEMS to rename hundreds of files. It is possible to use wild chars in the FIND field ?
    - All my file names start with date (example: 2010-04-10 xxxx.yyy) and i want to rename it to xxxx.yyy.
    thank you,
    Paulo

    I don't think Automator can do this task for you. Consider Name Mangler instead: http://manytricks.com/namemangler/.

  • Unable to open the photos in reviewer, every time I click on the photo on , it says do not have permission to view the photo. Please open the item in the finder choose the item and click on get info . What am I suppose to change in the setting on getinf

    Unable to open the photos in reviewer, every time I click on the photo on , it says do not have permission to view the photo. Please open the item in the finder choose the item and click on <get info>. What am I suppose to change in the setting on <get info>

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR..; sudo chown -R $UID:staff ~ $_; sudo chmod -R u+rwX ~ $_; chmod -R -N ~ $_; } 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take a few minutes to run, or perhaps longer if you have literally millions of files in your home folder. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if it frightens you, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password dialog will open. You’re not going to reset a password.
    In the dialog, select the startup volume ("Macintosh HD," unless you gave it a different name) if it's not already selected.
    Select your username from the menu labeled Select the user account if it's not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • How to find open SO Items with tax code for a particular day?

    Dear all
    If i want to see all open SOs(items), with tax code for a particular day, how to find using table VBAP in SE16?
    Please guide me
    Edited by: Julius Bussche on Mar 3, 2009 11:10 PM
    Please use descriptive subject titles and the search

    Hi GB,
    Its always better to see through the standard reports , as you will be able to see the aditional info as well.
    In the case of table in se16 you will be able to see one table at a time and then you need to manually figure out the fields that required.
    For example if you want to see the sales order details through tables then
    1.You have to go to VBAK to see the document type and then you need to go to VBAP to see the items , it means that you need to access 2 tables for this simple thing ....
    In standard reports there will be lot of joins between the tables and you can view the data more elobarately as weel.
    Note : In general if you want to see the complete details of the documents(open), then pls use the reports.
    Regards,
    Vvieks

  • Putting Variables in Action "Find Finder Items"

    Hello! I'm using Automator to make a workflow. One of my action in my workflow is to find finder items. I'd like to tell Automator to find items that start with a specific string of text (the text is "016") stored in a variable. Since Automator does not allow me to insert a variable directly, I tried to add the variable by adding the variable's UUID. I followed the method outlined in this website:
    http://hints.macworld.com/article.php?story=20080213200213250
    But even after I put my variable's UUID as "$(9051E0AA-257F-4F00-9A58-50677FB0C07E)", it seems that Automator does not understand, as the results of the action "Find Finder Items" returned no files at all. I tried to store my string as "Storage" and "Text" and used the same method, but it still didn't work. Thank you very much!

    I'm not sure what the action is using to search, but a name extension does not include the period. Another approach would be to get the entire contents of the memory card, and filter the items from there.

  • Automator Variable and Find Finder Items

    Hello!
    I am creating a quick Automator file to grab any files within a folder and copy them to another folder.  It prompts the user for a file name.  I used this http://hints.macworld.com/article.php?story=20080213200213250 post to attempt a work around for the Find Finder Items not allowing a variable as an input.  Any ideas how to get this to work?
    Thanks!
    -Josh

    Bit late but this came up tops when I was having the same issue.
    You will find your created variable at the bottom of the workflow panel, from ther eyou can just drag them into the drop down menus.

  • Session Variable : How to find out where all it is used in the repository?

    Hello Everyone,
    We have a requirement where we need to convert a few session variables into repository variables. For this we need to figure out where all is that session variable used in the repository and webcat (which all logical columns use it, which all prompts use it etc). We tried the query repository utility but that didnt help. Is there any other way to find that out? Will really appreciate any pointers from your side.
    Thanks in Anticipation,
    Karan

    Hi,
    To find the variables used in,
    Rpd : Open the rpd->Navigate to Tools Menu->Select "Utilities"->"Repository Documentation".This will generate a csv file with the associations
    Webcat :Open the webcat using catalog Manager->Tools Menu->Create Report-.Select the desired columns (Include Xml column)->Open the rpeort in excel find "Variable"->from this you can find the various variables used in the catalog.
    Rgds,
    Dpka

  • 'Filter finder items' by variable

    Hi,
    Is this just a flaw in Automator or am I being a n00b? All I want is to filter finder items (name) by a variable set earlier in the action. This should be a gimme, right? Wrong. No worky.
    Anyone know why / how to get this working ?
    thanks in advance

    An action needs to be written to use variables (specifically, a different kind of text field is used), and not all do. Several of Apple's actions are from a time before variables, so they probably just haven't been updated to use them yet.
    You might check out this macosxhints article, but it doesn't always work.

  • Tell Safari to open url using variables

    Hi,
    I need to be able to tell Safari to open a url using variables.
    Example:
    I type "Soul Men" (without the quotes) in MS Word Mac, then select it, then run the
    script and Safari opens as if I had opened imdb.com and searched for "Soul Men".
    The issue:
    The format for that imdb.com search url is:
    http://www.imdb.com/find?s=all&q=Soul+Men&x=12&y=12
    Notice that each word in the search terms is followed by a "+", except the last.
    So I would need to tell the script to create that url, and use variables for the search terms.
    I would need to account for any number of words in the variable.
    Hope that makes sense,
    Any help appreciated,
    Charles

    Hello
    As for building imdb's query url, you may try something like the CODE1 below.
    It includes code to handle characters in U+0080 and upper.
    (The imdb's query looks like using iso-8859-1 encoding, not utf-8, so the code is written as such.)
    --CODE1
    set n to "Soul Men"
    set u to imdbQueryUrl(n)
    return u
    on imdbQueryUrl(n)
    set sh to "echo " & quoted form of n & ¬
    " | iconv -f utf-8 -t iso-8859-1 " & ¬
    " | perl -M-utf8 -MURI::Escape -lpe '$_ = uri_escape($_); s/(%20|%09)+/+/og;'"
    return "http://www.imdb.com/find?s=all&q=" & (do shell script sh)
    end imdbQueryUrl
    --END OF CODE1
    As for getting text in selection of Word document, you may try something like the CODE2 below. Not tested, though.
    --CODE2
    tell application "Word"
    set t to content of selection
    --set t to content of text object of selection -- if above fails
    end tell
    --END OF CODE2
    As a whole, you may try something like this -
    --SCRIPT
    tell application "Word" to set n to content of selection
    open location imdbQueryUrl(n)
    on imdbQueryUrl(n)
    set sh to "echo " & quoted form of n & ¬
    " | iconv -f utf-8 -t iso-8859-1 " & ¬
    " | perl -M-utf8 -MURI::Escape -lpe '$_ = uri_escape($_); s/(%20|%09)+/+/og;'"
    return "http://www.imdb.com/find?s=all&q=" & (do shell script sh)
    end imdbQueryUrl
    --END OF SCRIPT
    Good luck,
    H

Maybe you are looking for

  • Error in RFC-PI-WEBSERVICE(SOAP)

    HI Expert, I am facing a problem with my scenario RFCPISOAP. It is a Asynchronous communication. Mesasge is successful in SXMB_MONI but failure in receiver side Adpter engine. Error is like Delivering the message to the application using connection S

  • O2A - Sending extensible attributes from OSM COM to OSM SOM

    I have a role of Oracle Senior OSM Consultant in an important RODOD implementation going on in a tier 1 client and I would like to understand one of the use cases implemented in the O2A cartridges, regarding the communication of extensible attributes

  • A bug in the JTree(Missing some nodes)

    I have an application which implement a JTree & DnDTree. The left hand side is the original JTee, the right hand size is DnDTree which allows user to Drag and Drop some node from left JTree. The bug is: when I grag some node to right DnDTree, once I

  • 1131 in autonomous mode. Not sure the below is even possible

    Hi all,   My boss asked me to try and set up an 1131 with 2 SSID's; serve dhcp for both SSID's from the AP and I cant trunk from f0 because the device the AP will connect to cant accept dot1q.  Does anyone know if this is possible?  If so pointing me

  • Help me. iphone keeps crashing and weird things appear on screen

    I have an iphone 5 on ios 7. when I use some apps, even default apps, my iphone seems to crash a lot. that's not all. when the phone crashes, a blue vertical bar about half an inch wide appears and moves from the left side of the screen then bounces