Use Automator to create new subfolders in a selected folder

This seems like it should be easy to accomplish, but I have had no luck.
I want to be able to select a folder, and then run an Automator Service to create a specific set of subfolders within the selected folder.
I am able to set up automator to create the subfolders, but it does so in the folder containing the selected folder.
Any suggestions on how to accomplish this simple task?

Which type of variable should I choose? I tried "text" but there's no way to set it to "input"? There are many Variables in the Library.
Here's how I have things set up now, I thought the "Service receives selected 'folders' in 'Finder'" (at the very top of the workflow area) would pull in the selected folder.
Thanks!

Similar Messages

  • Automator/Applescript to Create New Pages Doc in Selected Folder

    When working in Finder I'd like to be able to create a folder, and then (still within Finder) create a number of Pages documents inside that folder. This would help in organizing complex projects, and would be preferable to creating the documents (from the bottom up) in Pages and then laboriously assigning each document to a different folder.
    I've tried various solutions in Automator and Applescript but nothing has worked.
    For example:
    try
    tell application "finder" to set myFolder to (folder of the front window)
    on error -- no open folder windows
    set myFolder to path to desktop folder
    end try
    tell application "Pages"
    activate
    set myDocument to make new document with properties {path:myFolder}
    end tell
    But this gets an error "Can't make [the selected folder] of application "Finder" into the expected type. (-1700).
    In automator, I've tried to do the following:
    1. Get Selected Finder Items (which will be the folder I want)
    2. (Create new variable "path" and drag onto 1., which creates "Get Value of variable)
    3. (ignoring input) Get Specified Finder Item (specifying a blank Pages document)
    4. (accepting input) Copy Finder Item to variable "path"
    The problem with this is that step 2 returns both the desired folder AND the desktop. The result of the entire process, moreover, is that the blank Pages file is created (or rather copied to) the desktop ONLY, and not to the desired folder.
    Anyway, I hope someone can help me with this. It would really speed up my organizing process.
    Wes

    Taking care of true window's properties is often useful
    on run
    try
    tell application "Finder" to set myFolder to (target of the front window) as alias
    on error -- no open folder windows
    set myFolder to path to desktop folder
    end try
    set myNewDoc to my makeNewIworkDoc("Pages", "myNewDocument" & my dateTimeStamp() & ".pages", myFolder as text)
    end run
    --=====
    Creates a new iWork document from Blank.template,
    saves it and returns its pathname.
    example:
    set myNewDoc to my makeNewIworkDoc(theApp, docName, folderPath)
    on makeNewIworkDoc(a, n, d)
    local t, c
    if a is "Pages" then
    set t to ((path to applications folder as text) & "iWork '09:Pages.app:Contents:Resources:Templates:Blank.template:") as alias
    else if a is "Numbers" then
    set t to ((path to applications folder as text) & "iWork '09:Numbers.app:Contents:Resources:Templates:Blank.nmbtemplate:") as alias
    else
    if my parleAnglais(theApp) then
    error "The application “" & a & "“ is not accepted !"
    else
    error "l’application « " & a & " » n’est pas gérée !"
    end if
    end if
    set f to d & n
    tell application a
    set c to count of documents
    open t
    repeat
    if (count of documents) > c then
    exit repeat
    else
    delay 0.1
    end if
    end repeat
    save document 1 in file f
    end tell -- theApp
    return f as alias
    end makeNewIworkDoc
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    on dateTimeStamp()
    return (do shell script "date +P%Y%m%d-%H%M%S")
    end dateTimeStamp
    --=====
    Yvan KOENIG (VALLAURIS, France) vendredi 4 septembre 2009 20:51:02

  • Use LSMW to create new MMR.

    Hi All,
    When using LSMW to create new MMR, for example material 202851 was created. However, when using MM03 to display this material, it says"The material 202851 does not exist or is not activated"
    What does this mean?
    Thanks.
    Jason

    I am doing migration project for more than 11 years. I load all kind of material masters with its individual depth in one go.
    But I usually use IDOC method instead of the batch input.
    Because most of my projects are migration projects from SAP to SAP. But it works either way, anyway.
    Please tell in detail where your problems are, You say you loaded it, but SAP says you did not.  You have to trust SAP.
    It does not find your data. It is just a program that tells you it does not find your values, so there are no emotions in the game.
    In most cases the error is already in the source file.
    But you have to know has well how the source file has to look to make your migration succesfull.
    Search the forum, There have been many links to well documented LSMW documentation that show how the source file looks and what you need to do in batch input, to make it work.
    By the way, SAP has issued a very good book on LSMW. Even it costs a lot bucks, it is worth. As well the SAP documentation at service.sap.com/lsmw is worth to be read.

  • Could i use 'HR_MAINTAIN_MASTERDATA' to create new employee ?

    Dears
    it seems using PA40 to create new employee.
    i just want to create simple person with infotype 0000, but when i using 'HR_MAINTAIN_MASTERDATA' it will automitically jump into new screen of new infotype such as 0001 without push saving button the same as i use PA40.
    How could i control the screen sequence ?

    Hi,
    You cannot create  Employees using this FM HR_MAINTAIN_MASTERDATA. This FM can be used to maintain infotypes AFTER an employee/applicant has been created in SAP(pa40).
    i think there are no FMs to create Employees. There are FM's to create,update,delete,delimit etc other infotypes but IT0000(actions) Need to be performed either using PA40 or thru other mass data entry precedures like LSMW etc. where Recording of a transaction is performed.
    and coming to the jumping of screens u mentioned, it is initiated by Infogroups, where the sequence of infotypes to be maintained while performing an action are defined.
    you can remove the infotypes you dont want to maintain by identifying the infogroup and deleting it from there.
    also for this FM 'HR_MAINTAIN_MASTERDATA' the important import parameter itself is PERNR? how are u using this FM to create an employee?
    any special reason why u wanna use a Function module to create an employee?
    Message was edited by:
            Hruser

  • Using Automator to create script

    What I'd like to do is use Automator to create a script that will open an image as soon as it is transferred to a specific folder. I'm trying to generate some extra income by doing a bit of photography. Since my photo gear is not wireless or bluetooth capable, I'm going to transfer the image from the camera to my MacBook via an Eye-Fi card. Once the image is transferred into the designated folder, I'd like the script to open the file in either Preview, Aperture, or Photoshop so I can see if I need to re-shoot the image. Is that possible? I'm just not sure how to do it in Automator. Thanks to all.
    -- Dennis

    Unless I misread your post this should be simple. The steps below are for the Snow Leopard version of Automator but will be similar for other versions. I had the test file open in Preview because I do not have Aperture installed but there should be a similar Automator action for it.
    1. Create the folder that you want to drop the photos into and put it in a convenient place. I used the Desktop.
    2. When the opening dialog appears choose Folder Action.
    3. When the next Automator window appears notice the drop down menu that allows you to choose a folder. Click here and choose the folder you created earlier.
    4. Find the Automator action "Open Images In Preview" and drop it into the window's right side as the only step/
    5. Save your work.

  • I have an error when creating new folders, it renames the folder below it to the same name (super - next folder - parent's next sibling...)

    if I try to add a new folder to a sub folder, the program does add the new bookmark folder, but it also renames the next folder in line in the parent of the original "subfolder" to the exact same name...
    maybe I just need to reload the mozilla, maybe I was hacked and that is what they changed...
    I also have a similar problem with microsoft explorer, every time I try to add a new folder it gives it a starting wierd name besides "New Folder"
    I have an error when creating new folders, it renames the folder below it to the same name (super - next folder - parent's next sibling...)

    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Using Automator to create a text box of certain size

    I'm very new to using automator... in fact I haven't used it at all, but I am wondering if I can use it to create a text box of the same size each type to type in within preview (a PDF document).  Basically I want to click or push something and have a text box be generated that is the same size each time.
    Thanks!

    1. In the Finder actions you will need:
    - Get Specified Finder Items, and point it towards the folder that will contain the movie.
    - Get Folder Contents - to get what's inside the folder.
    - Filter Finder Items - set to filter by 'Name Extension' 'Is equal to' 'mov' and make sure all your video files have the right extension...
    - Open Finder Items - in QT Player - note that this might cause problems if there are multiple files in the folder...
    Then from the QT Player actions:
    - Play Movies.
    2. Save As... Application, then after saving, drag the app into the login items for the user account.
    3. That's going to need some AppleScript, but this thread should get you started:
    http://discussions.apple.com/thread.jspa?threadID=455825&tstart=0
    Ian

  • Finder - Create new files directly from a folder using finder ?

    In Finder, is there a way to do a right-click in a folder and create a new file like: New Text File or New Document from that location?
    I used to do this oftenly in Windows (right click, New Word document) but I have not found it in Mac OS X, any work around ?
    Thanks

    Try the [Apple feedback page|http://www.apple.com/feedback>. However, note that this is unlikely to be added. It would be a very cumbersome feature.
    On Windows, you're almost guaranteed to be tied to a particular set of document creation tools. If you're using an office suite other than MS Office, you're so weird you might as well be using a Mac! This means that commands like "New Document" make sense there.
    On a Mac, a "document" could be created with MS Word, Pages, TextEdit, NeoOffice, OpenOffice, Mellel, Nisus Writer Marinter Write, or any of a host of other programs. (Mac users tend to put less emphasis on the popular tool and prefer to use the tool that "fits the hand" best.) Further complicating things is the fact that "document" is a very generic term, since every spreadsheet is a document, every Photoshop file is a document, etc. The contextual menu would rapidly become unmanageable if it had to fill up with "New Whatever Document" commands for every app on your hard drive!
    It is possible for you to add your own custom services to the contextual menu using AppleScript or Automator, and you should be able to create services to create new documents for the apps you use frequently. Check on the [AppleScript forum|http://discussions.apple.com/forum.jspa?forumID=724] for guidance on how to do this.

  • Using Automator to create a "video server"

    I'm looking to turn an Xserve into a video server for a digital signage situation. I know I can use Automator to open a video file in Quicktime and automatically play it full screen, however, is it possible to do the following with automator (or in some other easy fashion):
    1. Have it go into a designated folder and open up the video file in that folder no matter what the files name is. (So I can update the video content monthly and just copy the new file into the folder and not have to change anything in the Automator script. I could always give the file the exact same name every month, but it would be nice if I didn't have to.).
    2. Automatically run the Automator script on system boot - so we can boot up the Xserve in the morning with 1 button and once the OS is up it automatically starts playing the video file.
    3. Last, (and this is probably the hard one), any thoughts on a way I can get the server to play a file to its end, and then check and see if there is a newer file present before looping? If not, it continues looping the same file, if so, it begins looping the new file instead? I'm guessing this would be more of an Applescript thing than Automater? This would be for a "content update while playing" situation.
    I may not even mess with number 3, but the first two are a must. I'm not asking that you take time to develop working code for all the above, just letting me know that I can do it and whether I should be looking at Automater or Applescript for certain functionality would be fine and I can further research from there.
    Thank you.
    Don Hertz

    1. In the Finder actions you will need:
    - Get Specified Finder Items, and point it towards the folder that will contain the movie.
    - Get Folder Contents - to get what's inside the folder.
    - Filter Finder Items - set to filter by 'Name Extension' 'Is equal to' 'mov' and make sure all your video files have the right extension...
    - Open Finder Items - in QT Player - note that this might cause problems if there are multiple files in the folder...
    Then from the QT Player actions:
    - Play Movies.
    2. Save As... Application, then after saving, drag the app into the login items for the user account.
    3. That's going to need some AppleScript, but this thread should get you started:
    http://discussions.apple.com/thread.jspa?threadID=455825&tstart=0
    Ian

  • How to Use iSetup to create new environment in copy of clean master.

    Hi,
    I want to use iSetup to create a complete new environment. No manual setup has been done yet in the copy of the master (no Business Group, No OU, no Chart of Acc: nothing). Source environment is being setup rightnow by functional consultants
    Can one please provide me with a manual or guideline how to start this challenging job. Maybe a best practise can be used ?
    In the end we want to setup an environment based on a clean master.
    ( practical data: eBS 12.1.2 on linux )
    Thanks in advance
    Guido

    Hi Guido,
    You can get in touch with [email protected] who is the product manager for iSetup. He would able to assist you to go forward in the right direction.

  • Use USERID from DB and increment it using position() to create new USERID's?

    I'm trying to do the following in XSQL:
    <?xml version="1.0"?>
    <database connection="test" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-request-params/>
    <xsql:query id-attribute="" tag-case="lower" rowset-element="maxuserid" row-element="idnum">
    SELECT MAX(USER_ID) AS "USERID"
    FROM LKUP_USER
    </xsql:query>
    <xsql:insert-request table="LKUP_USER" transform="/dvd/xsl/admin/createusertransform.xsl"/>
    </database>and XSL:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <ROWSET>
    <xsl:choose>
    <xsl:when test="/request/parameters[not(row)]">
    <xsl:for-each select="/request/parameters">
    <xsl:call-template name="generate-rows"/>
    </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
    <xsl:for-each select="/request/parameters/row">
    <xsl:call-template name="generate-rows"/>
    </xsl:for-each>
    </xsl:otherwise>
    </xsl:choose>
    </ROWSET>
    </xsl:template>
    <xsl:template name="generate-rows">
    <ROW>
    <FIRSTNAME><xsl:value-of select="firstname"/></FIRSTNAME>
    <LASTNAME><xsl:value-of select="lastname"/></LASTNAME>
    <PASSWORD><xsl:value-of select="password"/></PASSWORD>
    <EMAIL><xsl:value-of select="user-email"/></EMAIL>
    <ACCESSLEVEL><xsl:value-of select="accesslvl"/></ACCESSLEVEL>
    <USER_ID><xsl:value-of select="/maxuserid/idnum/userid + position()"/></USER_ID>
    </ROW>
    </xsl:template>
    </xsl:stylesheet>which returns the following:
    <?xml version="1.0" ?>
    - <!-- <?xml-stylesheet type="text/xsl" href="/dvd/xsl/admin/createeditdeleteuserconfirm.xsl"?>
    -->
    - <database>
    - <request>
    - <parameters>
    <password>test</password>
    <lastname>test</lastname>
    <firstname>test</firstname>
    <accesslvl>5</accesslvl>
    <user-email>test</user-email>
    </parameters>
    - <session>
    <access>1</access>
    <emailparam>[email protected]</emailparam>
    <adminfirstname>Malik</adminfirstname>
    <adminlastname>Graves-Pryor</adminlastname>
    </session>
    - <cookies>
    <JServSessionIdroot>57ta3u4mns</JServSessionIdroot>
    </cookies>
    </request>
    - <maxuserid>
    - <idnum>
    <userid>17</userid>
    </idnum>
    </maxuserid>
    - <xsql-error action="xsql:insert-request">
    <message>'java.sql.SQLException: ORA-01722: invalid number ' encountered during processing ROW element 1. All prior XML row changes were rolled back. in the XML document.</message>
    </xsql-error>
    </database>You can see what I'm trying to do, but I can't figure out exactly how to implement it. I want to avoid the problem of conflicting USER_ID values in the Oracle DB, so I figured, pull out the max USER_ID before submission and use that when 'row-ifying' the data to create new USER_ID which are incremented based on the position() function.
    Help? Is this even possible?
    p.s.: I realize that I might not be able to do this because the query is not a "request". Is there another way of accomplishing this task?
    p.p.s.: I don't have my XSLT book yet..
    Malik Graves-Pryor

    My book, Building Oracle XML Applications, has lots of XSLT material and examples :-)
    You should use:
    <xsql:set-stylesheet-param>
    to accomplish this. Remember again that the XML that the <xsql:insert-request> sees is not the XML of your data page, but the POSTED XML. The posted XML document will not have the maxid value in it. So, instead just use a top-level stylesheet parameter in your stylesheet:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <!-- Top level stylesheet parameter -->
    <xsl:param name="maxid"/>
    <xsl:template match="/">
    Rest of template here.
    Refer to value of maxid in any XPath expression
    in the stylesheet with $maxid
    </xsl:stylesheet>then in your XSQL page, you use <xsql:set-stylesheet-param> instead of <xsql:query> like this:
    <xsql:set-stylesheet-param name="maxid">
    select max(user_id) from lkup_user
    </xsl:set-stylesheet-param>However -- and this is not an XSQL issue, but a general database thing -- you need to be careful about concurrency issues using the SELECT MAX() trick. If two requests come in simultaneously, they will both SELECT MAX() and get the same current maximum number, then both try to insert a new user. One will (presumably) violate your primary key constraint.
    It's better to use database SEQUENCES instead, so the numbers are guaranteed to be unique. To use a sequence you would just change your SQL statement above to be:
    SELECT yoursequencename.NEXTVAL FROM DUAL
    instead of the SELECT MAX() query.

  • Problem using Automator to create "Watermark PDF Documents"

    After having updated our macs from Mavericks to Yosemite, the "Watermark PDF Documents" using Automator is no longer working.

    Hi Miykael,
    Do you have flash player installed on your system for that browser? Did you tried accessing that pdf file from a different browser?
    I would also recommend you to refer this KB Document : https://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html
    Regards,
    Rahul

  • I cannot create new file (.xslx) inside a folder with right click.

    I work with excel 2007 in window 7. Usually I create new files (.xlsx) by right click while I am inside a folder. But recently I have lost this opportunity. Now whenever I open a folder and want to create a new file (either .xlsx or .doc) I right click
    there. But there I find neither excel file icon nor word file icon. Power point, Access, Publisher file icons can be found there at that time. I do not know how I have lost the opportunity. Being failed to create files inside a folder now I go to start button
    or office button to create a new file.
    But I want to have the previous opportunity so that I can create a new file (excel or word) while I am visiting inside a folder. Is it possible? Thank, Nurul Amin.

    Hi,
    I would agree with Repair step provided by Robert, this will rewrite all the registry keys into the computer. Please have a try and let us know the result.
    Also, another quick way to rewrite all the registry keys and reregister the product is to run the problematic Office applications with "/regserver" switch:
    Press Win + R and type "winword.exe /regserver" or "Excel.exe /regserver" in the blank box, then press
    Enter.
    You might also want to give this a try.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • [SOLVED] Use clonezilla, or create new partitions then copy?

    I'm migrating my Arch for the first time. What would you recommend for a complete newb in this area, cloning the disk with some tool like clonezilla, or creating partitions manually and copying everything over?
    I saw a few threads on how to make partitions and copy stuff over, but they all leave me with uncertainties. Would cloning the hard drive be an easier option?
    Last edited by trusktr (2012-04-01 21:50:09)

    trusktr wrote:
    Hey graysky thanks for the answer. Could you also provide some insight into why not using clonezilla?
    For a someone doing this for the first time ever (like me), creating the new Linux partitions seems kind of tricky. The only time I've ever created partitions was from the Arch Install CD which made them automatically. I'd imagine that I would create each partition with the same size, except for the putting all the extra space of the new hard drive into the home partition.
    Best for learning now.  Making a partition is easy to do.  Just be sure you carefully keep track of drive letters when doing it.  Plus, the last time I looked, clonezilla wasn't updated for several years and didn't support ext4.  This may have changed though.
    Advice: draw out on paper your partition scheme, sort of like a map. ie
    / 15 GB /dev/sda1
    /boot 200 MB /dev/sda2
    /var 10 GB /dev/sda3
    /home <<rest of drive>> /dev/sda4
    Then use a util like fdisk or gptdisk to do the partitioning itself.  If using GPT, make sure to have an empty 1 MB partition for the BIOS!
    https://wiki.archlinux.org/index.php/GPT
    Here is a nice walk through using GPT --> https://wiki.archlinux.org/index.php/SS … DED_METHOD

  • Using Automator to create sequential folders

    I'm trying to make an Automator workflow that will grab a file, create a folder with today's date, create a new sequentially numbered subfolder, and copy that file into it.  Essentially "To Post/2013_06_11/1", then on the next run it will make "To Post/2013_06_11/2", etc.  I can get this to work once, but after the initial "1" folder is created I can't get it to make 2, 3, etc when I run it later. I can get this to work if I make all folders at once, but that doesn't fit our pipeline as we drop files throughout the day. Is there a way to do this in Automator, or does it require an Applescript to recognize the existing numbered folders? Thanks!

    So after a lot of tweaking, I think I have it working. Two problems I encountered with Camelot's script were getting errors while creating the very first folder, and when the folder numbers get into the double digits it was only looking at the last digit (11 would be followed by 2, for example). This is what it looks like now- it's probably pretty inelegant, but it works:
    New Folder: Today's date
    Set Variable: Today's date folder
    New Folder: named 0 in Today's date folder
    Set Variable: Folder 0
    Get variable: Today's date folder
    Get folder contents
    Sort Finder items by name, ascending
    Run Camelot's Applescript, modified
    on run {input, parameters}
              tell application "Finder"
                        set n to name of last item of input
                        return n + 1
              end tell
    end run
    Set variable: New sequential number
    New folder: named new sequential number, today's date folder
    Set variable: New sequential number folder
    Get selected Finder items
    Copy Finder items to New sequential number folder
    Get Variable: New Sequential Number
    Run Applescript:
    on run {input, parameters}
              display dialog "Posted to #" & {input}
              return input
    end run
    (this shows a window showing what number it's been posted to)
    Get Variable: Folder 0
    Run Applescript:
    on run {input, parameters}
              tell application "Finder"
                        delete {input}
              end tell
              return input
    end run
    (I had to do a script to delete the folder from a network)

Maybe you are looking for

  • Error Installing OIM - Ebiz User Management connector

    Hi all, I am trying to install ebusiness suite user management connector 9.1.0.1.0. But, while installation, I am getting an exception Invalid Connector Installation Directory Ensure that the connector installation files are in the specified director

  • TS3173 installed windows 7 on my imac.  When I start my imac, I get windows and cannot find the imac, what should I do?

    Using Boot Camp, I installed windows 7 on my new imac and when I rebooted, mac disappeared.  I tried to start the mac numerous times but it started with windows and all mac icons were gone.  Can anyone help please.

  • How to remove empty space from a file

    Hi all, Can any one help on how to remove the blank spaces from a file. I used trim function but unable to remove the spaces. I have a file in which there is a name like 'JAIRAM' and am storing this file in a variable FILE_CONTENTS. Now am unable to

  • Integrate JDeveloper with JBoss

    Hi. We're using JDeveloper 10.1.3.4 and need to integrate it with JBoss 4.2.3 so we can deploy servlets directly to the server and do breakpoints and debugging. Your help is appreciated. Thanks.

  • Never ending loop

    Hi all, I want to stop a loop which is not stopping. Is there any system variables in workflow, by setting that we can stop the workflow. Or please give me any other solution to stop it programattically,. Regards, Rubin Edited by: Rubin Luke on Sep 8