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)

Similar Messages

  • 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.

  • 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!

  • 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

  • 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

  • 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

  • Trying to use automator to change a folders permissions rights when something is put in it

    I'm trying to use automator so that when ever a folder or file is dropped into a shared folder on my desktop the permissions are updated to that new file/folder. Anyone know how to do this? Struggling at the moment. It would basically automate the following actions:
    - Select folder on desktop
    - Command + i to bring up folder info
    - Click lock and input password to allow finder to make changes
    - Click on cog icon to select 'apply to enclosed items...'
    - Close folder info panel
    The folder is a shared folder but when a new directory is put into the folder by myself the other person doesn't have access rights so I need to go through the above to rectify this. Or likewise if she puts an item into the folder I have to do the same so I have access rights. Basically we're too poor right now to set up a proper home network! Any other tips to solve this issue, even if they do need small financial backing would be greatly appreciated

    Yes, you can use the Clone Stamp tool on a precomposition layer, just like any other layer.
    If I understand your problem correctly, you're just having trouble opening the precomposition layer in the Layer panel.
    Here are instructions for After Effects CS4, from the
    "Opening and navigating nested compositions" section of After Effects CS4 Help on the Web:
    "Double-click a precomposition layer in the Timeline panel. Alt-double-click (Windows) or Option-double-click (Mac OS) to open the precomposition layer as a layer in the Layer panel."
    The behavior is reversed for earlier versions.

  • Can I use Automator to create a multi-page PDF from a selection of images?

    Well can I? I have looked at Preview extensively but found no option to create a multi-page document from all open images. I can create single-page PDF's easily, but that's not what I want.
    Does it make a difference if they are TIFF, JPEG, etc?

    Take a look at
    PDFLab
    It will create a multi – page .pdf from a folder of .jpgs. I am ** guessing ** it will work with .tiffs.
    No Alibi.
     Back up what you can't afford to lose.   Mac OS X (10.4.10)  

  • Create multiple folders in automator

    i cant seem to crack this there seem to be many applescripts out there but cant find one as basic as my needs, am trying to create a subfolder system within a folder to sort out work, id like to be able to do the following:
    tell automator to create x folders within folder with prefix xyz + sequential numbering ie. project001 project002 etc.
    i know it sounds basic and probably is but have been googling away without any joy and the create folder option in automator only makes one at a time which defeats the point.Have also tired the get items and rename but it doesnt want to change folders. any and all help greatly appreciated

    this is easily handled by apple script action.
    say the following will work.
    1. get selected (or specified) finder items.
    put the folder where you want to create all these subfolders here.
    2. run apple script
    <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}
    repeat with i from 1 to 10
    tell application "Finder"
    make new folder at input with properties {name:"xyz" & i}
    end tell
    end repeat
    end run</pre>
    the above makes 10 subfolders. adjust that as you like.

  • Using Automator to Save a Version?

    I was trying to use Automator on 10.7.4 to get this task done.
    So I have buch of encrypted pdf files.
    I have the passwords to open the file to read or print it.
    I want to decrypt all of them for access conveniency but I don't have the permission password to change the pdf security property.
    I figured a way around it.
    I found that I could double-click these pdf files with Preview.
    The Preview then asks for password.
    I copy & paste the password and the pdf is opened.
    Then after I press " Save a Version" , there is a window asking me to "Duplicate",.
    After I press "Duplicate", Preview will save a copy of that pdf file without encryption.
    It is easy enough to do that on several pdf files. However, I have hundreds of these pdf files.
    I was trying to use Automator to create a workflow but the main issue is that I did not see Save a Version action under PDFs in Automator.
    I also tried recording it but it was not successful.
    Any suggestion or trick to setup Automator for my task? Thanks.

    This is not possible in automator. Maybe applescritpt.
    Anybody else out there that would know?

  • How to make a CD of MP3 songs to play on a Bluray player without ITunes creating separate folders for each album

    I'm trying to make a CD full of MP3 files that I can play on my Bluray player for a long party, but when I burned the disc using ITunes, it created separate folders for each source album, and it won't play.  You have to open each individual album to get the songs to play.
    Can you make a cd that has all of the songs in one folder?

    I'm trying to make a CD full of MP3 files that I can play on my Bluray player for a long party, but when I burned the disc using ITunes, it created separate folders for each source album, and it won't play.  You have to open each individual album to get the songs to play.
    Can you make a cd that has all of the songs in one folder?

  • Creating new folders with Package Maker during preinstall actions?

    I have figured out MOST of what I need to have a successful install package produced with Package Maker BUT... how do you create an empty folder? My application uses a few folders for archiving and scratch, but unless I add some text file to that path I can't figure out how to create the folder I need. I am only fluent in Applescript so I hope I can use that to create these folders but I will learn enough unix if need be. If it requires any other language to accomplish this task I guess I will have to go another route.
    Any ideas?

    It isn't part of PackageMaker at all. It is defined in "URL Types" in your application. See the source code to Bwana for a simple example.

  • Creating public folders Exchange 2013 powershell

    Hello, we have exchange server 2013 with a lot of public folders 
    We use script to create this folders and to manage them.
    With upgrade to 2013 command New-PublicFolder was changed.
    parameter -server was deleted, and now we gaining error: 
     Creating Public Folder
    New-PublicFolder : Cannot find information about the local server XXX.XXXXXX.com in Active Directory. This may be related to a change in the server name.
    + New-PublicFolder -DomainController $dcserver -Name $grpn -Path '\Projects'
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [New-PublicFolder], LocalServerNotFoundException
      + FullyQualifiedErrorId : [Server=XXXXX,RequestId=XXXXXXXXXXXXXXX,TimeStamp=19.04.2014 3:55:21] 465E6BC6,Microsoft.Exchange.Managemen 
    t.MapiTasks.NewPublicFolder
    Now i found a solution but is it normal to use something like this :
    $exsession = New-PSSession -ConfigurationName Microsoft.Exchange –ConnectionUri "http://$mailserver/PowerShell/" -Authentication Kerberos
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) New-PublicFolder -DomainController $dcserver -Name $grpn -Path '\Projects'} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) Enable-MailPublicFolder -DomainController $dcserver -Identity $pffn} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) Add-PublicFolderClientPermission -DomainController $dcserver -User $grpnpg -AccessRights 'Author' -Identity $pffn} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) remove-PublicFolderClientPermission -DomainController $dcserver -User "Default" -Identity $pffn -confirm:$false} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) Add-PublicFolderClientPermission -DomainController $dcserver -User "Default" -AccessRights 'CreateItems' -Identity $pffn} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) Add-PublicFolderClientPermission -DomainController $dcserver -User "Anonymous" -AccessRights 'CreateItems' -Identity $pffn} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) Set-MailPublicFolder -DomainController $dcserver -Identity $pffn -HiddenFromAddressListsEnabled $true} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    Invoke-Command -Session $exsession {param($grpn,$pffn,$pfpn,$grpnpg,$dcserver) Add-DistributionGroupMember -DomainController $dcserver -Identity $grpnpg -Member $pfpn} -ArgumentList $grpn,$pffn,$pfpn,$grpnpg,$dcserver
    sleep 20
    #Closing remote session
    Remove-PSSession $exsession
    is there any other solutions to do this operations?

    Hello, we have exchange server 2013 with a lot of public folders 
    We use script to create this folders and to manage them.
    With upgrade to 2013 command New-PublicFolder was changed.
    parameter -server was deleted, and now we gaining error: 
     Creating Public Folder
    New-PublicFolder : Cannot find information about the local server XXX.XXXXXX.com in Active Directory. This may be related to a change in the server name.
    + New-PublicFolder -DomainController $dcserver -Name $grpn -Path '\Projects'
    You can specify the parameter mailbox but that is optional.
    Example:
    New-PublicFolder -Name SomeName -Path \Projects -mailbox "PF Mailbox"
    ...and you have more examples in the Technet Article New-PublicFolder
    Martina Miskovic

  • Using Automator to Batch Create PDFs

    I've been trying to find a way to make an Automator workflow that will take the name of a folder and combine it's files into a PDF with as little manual input as possible and have finally figured out how to do so. I've seen others ask how to do this for a while so I wanted to share how I did it.
    Why would you want to create PDFs? If you have scanned books, photos, documents or anything else on your Mac, you can create PDFs out of them. You can then store these in iTunes and either read them using Preview on your Mac or iBooks on your iOS device.
    What this workflow will do:
    Take a folder with images, get the folder's name, and create a PDF of the images with it's name.
    On the next pass of the workflow, it will send the previous folder to the trash.
    Create/have a backup of your files!
    Create a folder somewhere that you can drop your folders in. Name it Automator Dropbox. You can create one wherever you want, but this workflow was created with Automator Dropbox in mind so you'll need to change it as necessary.
    Open Automator and create a new workflow.
    Find Finder Items
    - Search Automator Dropbox
    - [All] of the following are true:
    - [Label] is [Red]
    This will search for any folders that were done before.
    Move Finder Items to Trash
    This will move the previous folder/files to the trash.
    Ask for Finder Items
    - Prompt: [Choose a Folder]
    - Start at: Automator Dropbox
    - Type: [Folders]
    This will ask you to choose the next item to convert to PDF.
    Set Value of Variable
    - Variable: pdfvariable
    This will take the name of the folder you just selected and use it to to rename your PDF.
    Label Finder Items
    - [Red]
    This will mark the folder you're working on for deletion the next time the workflow is ran.
    Get Folder Contents
    This will grab all the image files within the folder so that it can create a PDF out of them.
    Scale Images
    - To size (pixels): 1600
    This will scale the maximum dimension of your image down (or up) to 1600px. I find this to be the sweet spot for performance on the iPad 3, and it looks just fine. If the maximum dimension of your image is lower than 1600px, I'd create a duplicate workflow of this and leave out this step; otherwise you will be upscaling and your image won't look as good. You can also leave this step out if you want your original image size kept, but on the iPad 3 and below there will be a delay going from page to page.
    New PDF From Images
    - Save Output to: [Desktop]
    - Output File Name: tempname
    This will save your finalized PDF to the Desktop. You can change this to whatever you want; I would suggest the Automatically Add to iTunes folder located in [Music > iTunes > iTunes Media > Automatically Add to iTunes]. You will find your PDF in the Books category in iTunes.
    Rename Finder Items
    - [Replace Text]
    - Find: tempname in [Full Name]. Ignore Case checked.
    - Replace: [pdfvariable] (Drag pdfvariable from the variables window into the text field for "Replace". If you don't see the variables, go to "View > Variables."
    You can't just drag the variable into the PDF name field in the step above, so this extra step is necessary. It will rename your PDF with the name of the folder it was created from. It will also add the full file path, which will be taken care of in the next step.
    Rename Finder Items
    - [Replace Text]
    - Find: Users/yourname/Documents/Automator Dropbox in [Full Name]. Ignore Case checked.
    - Replace: LEAVE EMPTY
    This will delete the name of the path from the name of your PDF. If your working folder is not Documents/Automator Dropbox, change it to whatever that is.
    If you're running this workflow on a bunch of folders, you can simply keep your cursor over the workflow's play button and press the right arrow + enter to select the next item in queue. This workflow was made for using a little human interaction as possible, so if anyone has suggestions on how to improve on it please post below.
    One last thing - if you're seeing a red folder when you run the workflow to choose a folder, it's because spotlight hasn't indexed it yet and the workflow could not find it to delete it. Just go on to the next item.

    Someone (not me) has created an automator workflow that does this, using a shell script that runs the "pstopdf" unix command. I just downloaded it and tested it on 10 .eps files. You will need to edit the first automator action in the workflow to find the eps files you want (by default it looks for all eps files on your computer), but once you do that, it works like a charm! Converted my eps files to pdf's. Of course, once they are pdf files, you can use automator to convert them to whatever format you want.
    http://mad-sci.blogspot.com/2007/12/why-i-hate-computers.html
    (link to the actual zip file containing the workflow below)
    http://www.physics.mcgill.ca/~burkes/code/PDFworkflows.zip

  • Automator: Create 3 folders resize images and move .mov files?

    Hi there,
    I am new to automator but would like to learn how to use it.
    On daily basis I get a bunch of pictures and videos in high resolution.
    I would like to automate the following process:
    1. Create 3 folders: HQ, LQ, video
    2. Move the original high resulution .jpeg files to HQ folder
    3. Resize the files to 800x600px (landscape) or 600x800px (portrait) and save them in LQ
    4. Move the .mov video files into video folder
    5. Rename all JPEG files in LQ to a value that I can enter at this time (for example I type "3 bedroom apartment munich" and it will rename it to "3 bedroom apartment munich-1.jpg, ...-2.jpg, ...3.jpg, ...)
    Is this even possible with automator or do I have to use additional tools like "A Better Finder Rename 9"?
    Looking forward for some input to get started. Thanks for all who help me to get my daily job done much faster.
    Cheers,
    Chris

    You can start with this workflow. Download it (below) so you can see how it works. This is a workflow to handle the HQ and LQ options. On the video, that would be a separate workflow but easier -- you would just not combine it with this process.
    Let me know what you think and if we need to tweak it, then post back.
    Here is the workflow for you to download

Maybe you are looking for