Automator - how reset Finder Items?

I want to to defrag a big file, so I have thought to copy the file in an external disk, than rename the file in external disk and copy to directory in which there is the file to defrag.
Than revert to the original name the file in the external disk.
In this way I have a copy of the file in external disk and the original file and the file copied in HD.
I do that to avoid failure of external Hard Disk that could have the result to destroy the original file if this happen during the copy from external to internal HD.
I have made a workflow that do this:
1) Get Specified Finder Items (pictures/file)
2) Copy Finder Items (to DK1)
3) Rename Finder Items (DK1/file to DK1/filecopy)
4) Copy Finder Items (to pictures)
5) Get Specified Finder Item (DK1/filecopy)
6) Rename Finder Items (DK1/filecopy to DK1/file)
The problem is that in the 5 step the item passed to the 6 step are two (pictures/filecopy and DK1/filecopy).
I want only DK1/filecopy.
I have seen that Item passed to various step are:
1) Get Specified Finder Items (pictures/file) >>passed picture/file
2) Copy Finder Items (to DK1) >>passed DK1/file
3) Rename Finder Items (DK1/file to DK1/filecopy) >>passed DK1/filecopied
4) Copy Finder Items (to pictures) >>passed pictures/filecopied
5) Get Specified Finder Item (DK1/filecopy) >>passed two pictures/filecopied and DK1/filecopied
6) Rename Finder Items (DK1/filecopy to DK1/file) >> in error
I have have tried to make two workflow one with the step from 1 to 4 and another with the step 5 and 6.
If they run separately all is ok, but if they run in a single workflow (that is made with the step from 1 to 4 and the 5 step that recall the second workflow) happen the same thing that I have described before.

Stanley Horwitz wrote:
I have been working with Macs since 1986 and in the IT industry full time since about the same time and I honestly have no clue what you are attempting to do. What does "defrag a file" mean and why do you want to do that?
I want to copy a file to an external device, so system, copying file, write this without fragmentation, and then copy to original location.
In this way the result is to have the file unfragmented.
If you want to defrag your disk, by far the easiest and quickest way to do that is to take another disk drive that's as big or bigger in capacity as the disk you want to defrag, then format that disk, then simply use your favorite disk cloning tool to copy the contents of the disk you want to defrag to the other disk. The copying process to a newly formatted disk will write the data in an optimum manner onto the disk without any fragmentation on the destination disk. You can then, if you so desire, reverse the process and clone the cloned drive back to the original drive and you will end up with two defragmented disks with the same data on them. The biggest benefit to this strategy is that you get a complete backup of the contents of the disk.
OK, but I only want defrag 1 file, not all the disk.
If You see, I want the same manner that You suggest for the entire disk, applied only to 1 file.
There are also several utilities that will do disk defragmentation such as TechTool Pro and Disk Warrior. I think though that in all but the most extreme cases, it is a wast of time to use those utilities to defragment a disk. In fact, in most cases that I have seen on home Macs, the benefits of defragmentation are minimal at best, which is why I suggest simply doing a backup of the disk to another disk, because the big benefit there is that you have a fresh backup which is far more important in most cases than defragmenting a disk.
OK, I don't want defrag utilities, because I am not confident in the process.
For backup I use regularly Time Machine on two external disks.
All the matter is only to know if there is a manner to tell Automator wich is the file to use during the workflow.
Thanks.

Similar Messages

  • Automator's Filter Finder Items behaves incorrectly

    Can anyone confirm the misbehaviour of the Filter Finder Items in Automator when set to filter items whose date created is not in the last 7 days?  I have a workflow being used as a folder action to keep my downloads folder tidy but never runs right as it gets rid of content that I've just downloaded.
    Link to workflow: http://cl.ly/1S0h1I3m3r1t3l2a1W1J
    Insight would be appreciated.

    The only reliable way to do that would be to take an inventory of the filesystem, and compare it with an earlier inventory. I don't know of any easy way to do that with built-in tools. If you use Time Machine, there are third-party tools such as BackupLoupe that compare snapshots. Or you could try something like Uninstaller, though it's quirky and doesn't seem to be maintained much anymore.
    At an advanced level, there are UNIX tools such as mtree, which is built in, radmind, or tripwire, but you probably don't want to go there. I use radmind and mtree for different purposes, but they're not for the squeamish.

  • How to find item wise totals and header wise total using hierarchical ALV

    Hi Friends,
    I came across an issue of finding  item wise total using hierarchical ALV. I am getting header wise total by setting the field catalog. May you help me in finding  Item wise total.
    Regards
    Nikhil.

    hi,
    you must use "w_fieldcat-do_sum = 'X'" and change your layout like :
    w_sort-fieldname = 'FIELD'.
      w_sort-tabname   = 'TABNEME'.
      w_sort-up        = 'X'.
      w_sort-subtot    = 'X'.
      APPEND w_sort TO i_sort.
      CLEAR w_sort.
    you can use detailed code from http://wiki.sdn.sap.com/wiki/display/Snippets/Subtotalsinhirarchial+report.
    regards,
    orhan
    Edited by: goktasor on Jun 1, 2010 11:03 AM (need points : ) )

  • How to find items / programs opening on start up

    My MacBook Pro seems to be little slower than expected when I either reboot or start up, could this be that I have items (or many items / programs) trying to open on start up, how or where do I find these items / programs - Thank you

    In Preferences / Users and groups, you'll find all apps opening on startup.

  • Automator does not find items accurately using date stamps

    Greetings
    I am trying to write a simple workflow using Automator. Just check the creation/modification date of some files, and then do some work with them.
    It does not do the job right.
    If I ask for the files created or modified today, it finds well the files it has to find.
    But if I ask automator to find files created or modified last n days or weeks, it fails to select the proper files.
    Even worse, if I order it to select files, say, modified before july AND after august, it select files, when it's impossible a file can be last modified, created or whatever according that clausule.
    My system is an iMac bought on summer of 2011, with Mountain Lion 10,8,1 (I'll upgrade next week, after backing up all my stuff) and catalan language. I am stating that last bit because I wonder if there's an issue with the day/month/year date format we use around here, instead of month/day/year
    TIA

    What was your solution? I'd would love to know how to get Pages to work with Automator. What I want to do is import Word (doc)s to Pages and then export out to (pdf)s.

  • How to find item that do not have GI for long term.

    Hi MM Expert
    What is the best way to identify the the items that do not have goods movement (goods issue) for long term.
    I think of 1 idea using t-cd MCBE, but I would like to find out other possibility, to check more better idea.
    Do you have any good idea (Which table is useful for this analysis).
    Best Regards
    Keiji Mishima

    Hi Antony
    Thanks for the information.
    Your information is also helpful.
    Best Regards
    Keiji

  • How to find item is updating in Sharepoint designer workflow?

    Is there anyway we can get when list item updating in sharepoint designer workflow?. I have status ="New" it is need to send only one time when new item created.
    But now it is sending emails when item is updating with status="New". So I want check if it is new then only check status="New" and send email. otherwise No.
    ItsMeSri SP 2013 Foundation

    Hi ,
    According to your description, my understanding is that you want to send email in workflow only when the item is created and the status is New.
    For this issue, I suggest you create a new Yes/No column called “Edited”, and set the default value to No. When you edit it after creation, change the column to Yes.
    You can set the workflow like the screenshot:
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Automator - (error -50) Moving items

    Hello,
    I'm having a problem with Automator where "Move Finder Items" throws error -50 when the previous Action "Find Finder Items" doesn't find anything and therefore doesn't pass anything to the Move action.
    How would I go about stopping this error?
    Thanks

    install this action
    http://automatoractions.com/files/stopifinputisempty1.0.html
    and insert it right before the "move finder items" action.

  • Folder Action + Move Finder Items = Zero KB files

    I've got a folder action set that is supposed to run the Automator Action "Move Finder Items" on any file that gets placed in a specific folder (called "Folder A") and move it to "Folder B". I'm having an issue with larger files though.
    As soon as I begin to transfer the file to "folder A" , the folder action runs and results in a "Zero KB" file in "Folder B".
    Is there any way to keep the Folder Action from triggering until the file has completely copied to the folder with the Folder Action attached ("Folder A")?
    A side note: I have this same folder action running on an iMac with Mac OS 10.6.3 and it works great . (This one was made with the newer version of Automator that shipped with 10.6 vs. Automator on 10.5 which made the action I am having trouble with)
    Any input would be appreciated!

    There is a check in *Snow Leopard* to see if the items have completed their copy/download, but Leopard does not do any checking - the script is triggered immediately. You can add your own delay with a *Run AppleScript* action, though, for example:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters} -- wait for file copy to complete by testing the size of the containing folder
    set theFolders to {} -- to handle items in different folders
    set skippedItems to {}
    repeat with anItem in the input -- get a list of unique folders
    tell application "Finder"
    get (container of anItem) as alias
    if the result is not in theFolders then set the end of theFolders to the result
    end tell
    end repeat
    repeat with aFolder in theFolders
    set timeToWait to 30 -- time to wait for copy to complete
    set interval to 2 -- test every interval seconds
    set copied to false
    tell application "Finder" to set currentSize to size of aFolder -- get initial size
    repeat with timer from timeToWait to 1 by -interval -- check every interval seconds up to maximum time
    delay interval
    tell application "Finder" to set newSize to size of aFolder -- recheck size
    if (newSize is equal to currentSize) then
    set copied to true
    exit repeat -- success
    else -- update size
    set currentSize to newSize
    end if
    end repeat
    if not copied then set the end of skippedItems to quoted form of (aFolder as text) -- timed out
    end repeat
    showSkippedAlert for skippedItems
    return input
    end run
    to showSkippedAlert for skippedItems
    show an alert dialog for any items skipped, with the option to cancel the rest of the workflow
    parameters - skippedItems [list]: the items skipped
    returns nothing
    if skippedItems is not {} then
    set {alertText, theCount} to {"Error with waiting for items to copy", count skippedItems}
    if theCount is greater than 1 then
    set theMessage to (theCount as text) & space & " folders timed out"
    else
    set theMessage to "1 folder timed out"
    end if
    set theMessage to theMessage & " - copy of contents may be incomplete:"
    set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {skippedItems, AppleScript's text item delimiters} to {skippedItems as text, tempTID}
    if button returned of (display alert alertText message (theMessage & return & skippedItems) alternate button "Cancel" default button "OK") is "Cancel" then error number -128
    end if
    return
    end showSkippedAlert
    </pre>
    The action will check the folder sizes, and when there is no change (or the wait times out) the input items are passed on.

  • 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

  • Copy Finder Items - how to generic for multiple user home directories?

    I am creating an Automator workflow to allow my networked users to be able to copy certain files from a central location to their local home directory and overwriting their local copy. How to I make the destination of the Copy Finder Item to be generic home directory (something in the like of "~/Document/MegaSeg User Data/MegaSeg Database" instead of a fixed user home directory)?

    Hi
    It may be easier with an appleScript (which you could incorporate into an Automator action if you wanted).
    --start script
    set the_file to -- path to the file you want to copy goes here
    set docs_folder to path to documents folder from user domain
    tell application "Finder"
    set target_folder to folder "MegaSeg Database" of folder "MegaSeg User Data" of docs_folder
    duplicate the_file to target_folder with replacing
    end tell
    -- end script
    This will replace existing files of the same name in the target folder. Hope it helps.

  • Automator: Copy Finder Items Question

    Hola,
    Quick question about the Copy Finder Items action in automator: the "replace existing files" option, how is sameness determined? In other words, according to what criteria does Automator determine that two files are the same, and so eligible for replacement in the destination folder when that option is chosen? For example, would file Mydog.doc, modified 10/14/05, 230k be viewed as the same thing as Mydog.doc., modifided 2/21/06, 150k?
    Cheers,
    stu

    As far as the Finder is concerned, the comparison is based on file name only.
    It doesn't care about file size or modification date. If the name is the same the existing file will be replaced.

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

  • 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 - Filter Finder Items filtering contents of sub folders

    I have an external hard drive and I want to keep my iTunes music library automatically backed up on it. I am using automator to copy my most recent files to the external (run the script once a week). I let iTunes manage all my audio files, etc so I figured the created, modified, opened dates would be the best way to filter the items I want to copy over. The workflow is as follows.
    1) Get Specified Finder Items (iTunes Library Music folder)
    2) Get Folder Contents (All artist directories (Repeat for each subfolder found is NOT checked)
    3) Filter Finder Items (ANY of Date Last Modified, Date Created, Date last opened in the last week)
    4) Copy finder items (to my external hard drive)
    I am having two problems.
    1) If I play a song from my second hard drive iTunes copies it into it's directory when it opens... iTunes Music > Artist > Album > Song.mp3. The mp3's modified date, created date, and last opened date is the same as the file that got copied. The new Artist and Album directories that were created by itunes have current created dates (makes sense). However, the filter is still not catching it. Only if the mp3 is current will the filter catch it. I DON'T have 'Repeat for each subfolder found'... shouldn't the filter check for the folder's modified, created and last opened dates?
    2) If everything works the way I want it to I see this to be a problem in the future. If I add an album by an artist that I already have an album for, the filter will skip it. Any suggestions on how I could handle this problem?
    Thanks.

    Found out that since Hebrew was set up first in the language option the filter on textual was failing. After I changed the order of the languages in the language preferences the file filter by name, extension etc… worked O.K.
    Nati

Maybe you are looking for

  • How do I set up an iTunes account for my wife on one MacBook pro, so she can sync her new iPhone?

    How do I switch my iTunes account with my wife's iTunes account on a MacBook pro so she can sync her new iPhone with her stuff?

  • Understanding the TextLoc.offset property

    I am working on a script that, among other things, converts autonumber strings in a structured document into regular text. One thing that has been surprisingly unintuitive is setting up the TextLoc object that is passed to the AddText() function in o

  • A Rookie's doubt.

    Hey there, nice to meet you all, i'm just starting here, so i hope i'll be able to explain myself properly, if something i write just ain't clear, please let me know and i'll work hard to refrase it. I'm starting with flash, and my boss asked me to m

  • The dreaded blinking folder

    ok, here's the story. my wife's mac mini (brand new) locks up and it for a force shut down. I start it up again and it comes up (after about a minute) with the dreaded blinking blue question mark saying that it can't find the system folder. there is

  • Cannot Install Anti Spam Agents - get-transportserver cmdlet not found

    Getting the following error when trying to install antispam agents on hub transport server (single exchange server 2010 environment, no edge server): [PS] D:\Program Files\Microsoft\Exchange Server\V14\scripts>.\install-antispamagents.ps1 get-transpo