Apple script to copy folder contents

I am looking for help to create an apple script, or automator task that will copy the contents of a specified folder and paste them into another specified folder. There will just be a couple of files within this folder, and each time it creates the duplicate I dont want it to erase pervious copies already created within the destination folder, so it will probably need to change the name of the file (....1, ...2, ....3, something like that).

I tried setting up this automator app
You have to drop folder A onto the app ignored for it to do it's thing. Dropping folder A
on to it 3 times in a row gives this in folder B.
You can experiment with the app to get what you want.  One should be able to create that script as a folder Action so that any file dropped into folder A will automatically get copied to folder B.  I was unable to get that to work.  Maybe someone with more experience with Automator can help in that area.

Similar Messages

  • Folder script to print folder content automator

    Hi,
    I had a folder script that printed any document added to a folder and when printed, then it deleted the document.  That script help me to print from an OS 9 emulator  (SheepShaver) through OS X.
    For I don't know the reason, the folder script does not work anymore.  It could be Yosemite or my new iMac upgrade.  Find out ?  And Apple Script is far away in my mind ... so I am not really sure what is going wrong.
    I would like to have the script to print from any folder it is assigned to, instead of applying to only one folder.  Can you help ?   Here is the actual folder script:
    property myPrinter : "HP_Officejet_8500" -- Le nom exact de l'imprimante est obtenu en faisant «lpstat -p» dans terminal.
    property filesFolderName : "Nous/Documents/SheepShaver/Données/En impression" -- Déterminer le chemin du dossier contenant les fichiers à imprimer.
    property fileStamp : ""
    property theFilePath : ""
    on adding folder items to thisFolder after receiving theseItems
              -- Définir le chemin du dossier contenant les fichiers à imprimer.
              set filesFolderPath to POSIX path of (path to users folder) & filesFolderName & "/"
              -- Pour chaque fichier dans le dossier ...
              repeat with i in theseItems
                       -- ... définir les informations du fichier; ...
                       set {name:fileName, name extension:fileExt} to info for i
                       -- ... définir l'estampe du fichier (date et l'heure), ...
                       --set fileStamp to do shell script "/bin/date +'('%d-%m-%y' '%HH%MM%S')'"
                       -- ... définir le chemin du fichier, ...
                       set theFilePath to quoted form of (filesFolderPath & fileName)
                       -- ... et enfin, l'imprimer sur l'imprimante choisie.
                       do shell script "usr/bin/lpr -P " & myPrinter & space & theFilePath
                       do shell script "/bin/sleep 10"
                       -- ... détruire le fichier imprimé.
                       do shell script "/bin/rm " & theFilePath
                       get theFilePath
              end repeat
    end adding folder items to
    Thanks in advance.
    Robert Lespérance

    You would think this would work, remember universal access - enable access must be on.
    tell application "System Events"
    tell application "Finder" to activate
    tell process "Finder"
    keystroke "a" using command down
    keystroke left using command down & option down
    end tell
    end tell
    The Select All works, but the collapse all doesn't
    CE Quickkey will do it with ease but that $80us a machine
    http://www.cesoft.com/products/qkx.html
    you could try the OS X scripting addition but it shareware and want money too and I don't know if it will work
    http://osaxen.com/files/extrasuites1.1.html
    Must be a free OS X scripting addition (osaxen) that does keystokes
    good luck.

  • Cannot copy folder contents?

    Hi All,
    I am trying to copy one folder to another location.
    When I take one folder and paste it to another folder.
    I am able to get the folder name but when i open that folder it is blank.
    I would like to know correct method to copy the folder along with its contents to another location.
    Below code only copies folder and not its contents.
    IInfoObject item = (IInfoObject)infoObjs.get(0);
    IInfoObject itemToCopy=infoObjs.copy(item, IInfoObjects.CopyModes.COPY_NEW_OBJECT_NEW_FILES);
    itemToCopy.setParentID(Integer.parseInt(destinationfolderID));
    newTitle=item.getTitle();
    System.out.println("New Title ="+newTitle);
    itemToCopy.setTitle(newTitle);
    System.out.println("Organize -Before  Saving");
    itemToCopy.save();
    Thanks in advance.
    Praveen.

    Hi Ted
    Thanks for reply.
    As you have mentioned to copy teh folder first,hope this line of my code does that thing
    IInfoObject itemToCopy=infoObjs.copy(item,IInfoObjects.CopyModes.COPY_NEW_OBJECT_NEW_FILES);
    The next step you mentioned was to copy the contents to that that new folder..so which means looping through the folder hierarchy or by using any classes like IContainer or IFolder ...
    But even then if using IContainer class there is no option for setting the children of that folder to the new folder...
    I only see the getChildren().
    Could you please provide us with a sample code snippets.
    Thanks
    Praveen.

  • Help creating apple script to create folder and set access levels

    I'm trying to create folders in FileMaker Pro using apple script and need some help in setting the access level for the folders.  I want to set both Staff and everyone to Read and Write access.   Secondly I would like to have a function key set on the desktop to create new folders and set that same access level.  The default access is Read and I can not find a way to change that.
    Thanks

    I'm trying to create folders in FileMaker Pro using apple script and need some help in setting the access level for the folders.  I want to set both Staff and everyone to Read and Write access.   Secondly I would like to have a function key set on the desktop to create new folders and set that same access level.  The default access is Read and I can not find a way to change that.
    Thanks

  • Automated script to replace folder contents

    Hi,
    I would like to write a script that does the following:
    -find all folders with name ending in _2 (underscore 2)
    -for each such folder named X_2:
    -find the folder X (with same name but without the _2 suffix)
    -move all files of X into X_2 (overwriting existing files with the same name)
    Any ideas on how to do this?
    Thanks

    Try the AppleScript forum under OS X Technologies or the Automator forum under Leopard.

  • Coping folder contents and sub folders

    So, I'm working on a little practice folder sync project (fun with my mac)...
    ...and I'v gotten hung up a bit because my little copying app doesn't seem to count folders and sub folders (which I suppose makes sense).
    My initial idea was to take just the date of modification and compare it to the last date that the app was run, inorder to only copy changed files. But this seems problematic on a few levels, so...
    So, my two part question is:
    1. Is there a simple command to copy folder contents and sub-folder contents, or do I need to tell the script to do each sub-folder individually?
    2. I imagine that a better way to manage which files/folders need to be updated is to create a file with a list of the contents, and dates of modification, and compare the new folder list and the old folder list to each-other... ok.. so, um. yeah. that sounds tricky.

    >1. Is there a simple command to copy folder contents and sub-folder contents, or do I need to tell the script to do each sub-folder individually?
    There are two common solutions to this.
    The first is to use the Finder's 'entire contents of...' command to get a list of everything in the folder, including sub-folders, the second is to make your script recursive - that is, it calls itself several times over.
    In the first case it's as simple as:
    tell application "Finder"
    set allItems to entire contents of folder "path:to:source:folder:"
    -- rest of code goes here
    end tell
    This can have problems, though, especially on very large directories since the Finder is not very efficient at building a list of hundreds or thousands of files.
    The recursive path is a little trickier, but you write a handler to process a folder then repeatedly call that handler, like:
    <pre class=command>on run
    set sourceFolder to (choose folder)
    processAFolder(sourceFolder)
    end run
    on processAFolder(theFolder)
    tell application "Finder"
    set allItems to items of folder theFolder as alias list
    repeat with eachItem in allItems
    if class of eachItem is folder then -- we have a subfolder
    processAFolder (eachItem)
    else
    -- code here to compare the file and back it up
    end if
    end repeat
    end tell
    end processAFolder</pre>
    So here you walk through the folder, each time you find a new folder, you walk through that until you're done. The code takes care of keeping track of where you are in the folder hierarchy.
    >2. I imagine that a better way to manage which files/folders need to be updated is to create a file with a list of the contents, and dates of modification, and compare the new folder list and the old folder list to each-other... ok.. so, um. yeah. that sounds tricky.
    There's no need to keep a file. Assuming you have two folders you can just walk through one of them checking to see if each item exists in the other, then copy the newer file to the other directory, like:
    <pre class=command>on processAFile(fileName, sourceDir, destDir)
    tell application "Finder"
    -- check if the files exist
    set sourceFileExists to (file fileName of folder sourceDir exists)
    set destFileExists to (file fileName of folder destDir exists)
    -- now comes the logic
    if sourceFileExists and not destFileExsits then
    duplicate file fileName of folder sourceDir to folder destDir
    else if destFileExists and not sourceFileExists then
    -- assuming you want a two-way synch
    duplicate file fileName of folder destDir to folder sourceDir
    else -- both files exist, so check mod dates
    if (modification date of file fileName of folder sourceDir) > (modification date of file fileName of folder destDir) then
    duplicate file fileName of folder sourceDir to folder destDir
    else if (modification date of file fileName of folder destDir) > (modification date of file fileName of folder sourceDir) then
    duplicate file fileName of folder sourceDir to folder destDir
    end if
    end if
    end tell
    end processAFile</pre>
    If you're not planning a two-way synch an even simpler option is to just keep track of the last time the synch was run. Then all you need to do on subsequent runs is ask the Finder for 'every file of folder sourceFolder whose modification date is greater than lastRunDate'.

  • Apple Script "Folder Contents to UPPER or lowercase"

    So I use the apple script "Change Case of Item Names" from the "Script Menu" all the time when I need to convert a handful of files because of my OCD organization techniques. One thing that frustrates me is that it will not change ALL files within a folder, within a folder and so on. Say I have a folder with 25 folders, and within each of those folders there are 200 files. I'd like to set the script on that very fist folder to change ALL the contents within it to either UPPER or lower case. Can anyone help me out by giving me a script or navigate me to a script that I've overlooked?
    Thanks,
    -Zach

    in the future please post apple script questions in the Apple script forum under mac os x technologies.
    the following modification of the built in script should do what you want
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 335px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    try
    tell application "Finder" to set the source_folder to (folder of the front window) as alias
    on error -- no open folder windows
    set the source_folder to path to desktop folder as alias
    end try
    display dialog "Change case to:" buttons {"Cancel", "UPPER", "lower"}
    set the button_pressed to the button returned of the result
    tell application "Finder"
    repeat with this_item in entire contents of source_folder
    set the current_name to the name of this_item as text
    if the button_pressed is "lower" then
    set the name of this_item to my change_case_of(the current_name, "lower")
    else
    set the name of this_item to my change_case_of(the current_name, "upper")
    end if
    end repeat
    end tell
    beep 2
    on change_case_of(this_text, this_case)
    if this_case is "lower" then
    set the comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    set the source_string to "abcdefghijklmnopqrstuvwxyz"
    else
    set the comparison_string to "abcdefghijklmnopqrstuvwxyz"
    set the source_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    end if
    set the new_text to ""
    repeat with thisChar in this_text
    set x to the offset of thisChar in the comparison_string
    if x is not 0 then
    set the new_text to (the new_text & character x of the source_string) as string
    else
    set the new_text to (the new_text & thisChar) as string
    end if
    end repeat
    return the new_text
    end change_case_of</pre>
    paste it into script Editor and save it in /Library/scripts/Finder Scripts. call it something like "recursive change of names".

  • Apple loops for garageband pack doesn't show the folder content (loops, files...)  in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.

    apple loops for garageband pack doesn't show the folder content (loops, files...)  in ableton live suite 8 library browser, but I can see all the loops in the folder from finder. how can i fix this? help please.

    Thanks Barney, I tried that but all that comes up in Spotlight are the log files that show the file paths! I don't know how Steam works. Are all the files held by Steam on their server perhaps?

  • CF scripts not consistently listing contents of folder

    Hello.
    I upload multiple types of files to the server. Sometimes
    they are folders, word docs, ppts, pdfs or xls files. There is a
    script that runs that is supposed to list everything that I have
    uploaded into a directory. The problem is, it does not work
    consistently. Sometimes it will display all files, subdirectories,
    files within, sometimes it will say that nothing is there. I am not
    sure why it will work with some files/folders, and won't with
    others. Some folders work great, some don't. It may be a
    permissions problem, I'm not sure...
    Here's an example - I have a folder and a word document in
    the "root" files directory. When viewing in the browser, it
    displays "No Files Found". Then if I move a ppt back a directory -
    to the root, all 3 items (word doc, folder and ppt) will then show
    in the browser. For some reason the ppt triggers everything to
    suddenly show. This "magical" ppt does not work for every directory
    though. Some items just won't show no matter what.
    Here's a sample script that lists the contents of the
    directory:
    <cfinclude template="../usercheck.cfm">
    <cfparam name="URL.module" default="">
    <cfparam name="URL.file" default="">
    <cfparam name="URL.action" default="">
    <HTML>
    <HEAD>
    <TITLE>Title</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
    charset=iso-8859-1">
    <link href="../links.css" rel="stylesheet"
    type="text/css">
    <!-- End Preload Script -->
    <style type="text/css">
    <!--
    .style3 {color: #FFFFFF; font-weight: bold; }
    .style6 {font-size: 10px}
    -->
    </style>
    </HEAD>
    <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0
    MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();">
    <a href="/index.html"><img src="/Images/graphic.gif"
    width="169" height="84" border="0"></a>
    <br>
    <cfset pathn =
    "#getDirectoryFromPath(cgi.PATH_TRANSLATED)#files">
    <CFIF (URL.file IS NOT '')>
    <CFDIRECTORY ACTION="LIST"
    DIRECTORY="#pathn##urldecode(url.module)#"
    NAME="FileCheck"
    FILTER="#URL.file#">
    <cfif URL.action eq "Delete">
    <CFIF FileCheck.RecordCount GT 0>
    <cffile file="#pathn##urldecode(url.module)##URL.file#"
    action="delete">
    <cflocation
    url="module.cfm?module=#URLEncodedFormat(url.module)#">
    </CFIF>
    <cfelse>
    <CFIF FileCheck.RecordCount GT 0>
    <!--- <cfhttp
    method="Get"
    url="#getdirectoryfrompath(pathn)##URL.file#"
    path="#pathn#"
    file="#URL.file#"> --->
    <CFHEADER
    NAME="content-disposition"
    VALUE="attachment; filename=#URL.file#">
    <CFCONTENT type="application/unknown"
    file="#pathn##URLdecode(url.module)##URL.file#"
    DeleteFile="No"></CFCONTENT>
    </CFIF>
    </cfif>
    <cfelse>
    <CFDIRECTORY ACTION="LIST"
    DIRECTORY="#pathn##urldecode(url.module)#"
    NAME="dirlist">
    <table width="487" border="0" align="center">
    <tr bgcolor="#004B8D">
    <td width="479" height="36"><span
    class="style3"> Physician Modules
    </span></td>
    <td></td>
    </tr>
    <cfif #dirlist.recordcount# gt 2>
    <CFOUTPUT QUERY="dirlist">
    <CFIF type IS 'File'>
    <tr bordercolor="##D5EBFF" bgcolor="##D5EBFF">
    <td width="479" bordercolor="##D5EBFF" bgcolor="##F4FAFF"
    class="links">
    <span class="style6"><a
    href="#cgi.SCRIPT_NAME#?module=#URLEncodedFormat(url.module)#&file=#name#"> #left(name,le n(name)-4)#</a></span>
    </td>
    <td width="50" bgcolor="##FFFFFF">
    <cfswitch expression="#right(name,3)#">
    <cfcase value="xls">
    <cfset imagesrc="/Images/excel.gif">
    </cfcase>
    <cfcase value="pdf">
    <cfset imagesrc="/Images/pdf.gif">
    </cfcase>
    <cfcase value="doc">
    <cfset imagesrc="/Images/word.gif">
    </cfcase>
    <cfcase value="ppt">
    <cfset imagesrc="/Images/powerpoint.gif">
    </cfcase>
    <cfdefaultcase>
    <cfset imagesrc="/Images/unknown.gif">
    </cfdefaultcase>
    </cfswitch>
    <div align="center"><img src="#imagesrc#" width="31"
    height="27"></div>
    </td>
    </tr>
    <cfelseif type eq 'Dir'>
    <cfif ((name neq "." ) AND (name neq "..")) >
    <cfset tempname = #url.module# & "" & #name#>
    <tr bordercolor="##D5EBFF" bgcolor="##D5EBFF">
    <td bordercolor="##D5EBFF" bgcolor="##F4FAFF"
    class="links"><a
    href="#CGI.SCRIPT_NAME#?module=#URLEncodedformat(tempname)#">#name#</a></td>
    <td bgcolor="##FFFFFF"
    class="links">Directory</td>
    </tr>
    </cfif>
    </cfif>
    </cfoutput>
    <cfelse><!--- <cfif #dirlist.recordcount# lt
    2> --->
    <tr bordercolor="#D5EBFF" bgcolor="#D5EBFF">
    <td bordercolor="#D5EBFF" bgcolor="#F4FAFF"
    class="links">
    <span class="style6">No Files
    Found</a></span></td>
    <td bgcolor="#FFFFFF"> </td>
    </tr>
    </cfif>
    </table>
    </cfif>
    <table width="100%" border="0" cellpadding="0"
    cellspacing="0" class="links">
    <tr>
    <td height="50" align="center" valign="middle"
    class="links">
    <cfinclude template="../navmenu.cfm">
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    Thanks for your help.

    You are not able to do this with CF directly.  It would be a function of the web server.
    You could move all documents other than .cfm into a folder outside of the web root, then use tags such as cfcontent to deliver those files programatically (as often happens when you download software off of a website now days).  However I suspect this isn't what you are looking for.  Just in case here is a quick example of how you may do the force download of document from outside root:  http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/force-file-download-27

  • Can I copy the content of my Apple TV to a new Mac?

    I have lost my entire iTunes library from a house fire, but I have my Apple TV with over 14,000 songs on it. Most from my also lost cd collection.
    Can I copy the content of my Apple TV to my new Mac? If so, how

    Not without doing things that void the warranty. You can always disassemble it, put the hard drive into an enclosure and copy things off it that way. Not for the faint of heart.

  • Apple Script to automatically apply automator folder action workflows

    Hello
         I'm trying to get an applescript to automatically apply an automator folder action workflow to a folder..
         Getting applescript to apply a scpt file to a folder as a folder action is straight forward. However, it seems that scpt files are different than automator folder action workflows..
         Normally I would just script the folder action in apple script, but this is for someone that can handle automator, but not apple script coding. This whole scripting is to solve the issue of subdirectories being creating and then files or subfolders being created there after. So we need to try to get automator folder actions to propagate though..  easy enough with applescript..
    Any help would be appreciated...

    Here is the code that I needed to happen...  Maybe I just missed something in automator... but this applescript properly applies itself to subfolders, which then allows me to apply specific scripts based on folder names and locations. Also if the subfolders already exist.. the scirpt also is applied to those.
    on adding folder items to this_folder
      createlist(this_folder)
    end adding folder items to
    on createlist(item_list)
              set ActionScript to " REMOVED FOR PUBLIC DISPLAY:ApplyScriptSubfolders.scpt"
              set the the_items to list folder item_list without invisibles
              set item_list to item_list as string
                   repeat with i from 1 to number of items in the the_items
                     set the_item to item i of the the_items
                                       set the_item to (item_list & the_item) as alias
                                       set this_info to info for the_item
                                       if folder of this_info is true then
                              tell application "System Events"
                                                                          display dialog "Attching script to " & the_item as text  --
                                     attach action to folder (the_item as text) using ActionScript
                                                           end tell
                                my createlist(the_item)
                                       end if
                   end repeat
    end createlist
    I appreciate your help.. if you now know what has to happen and have a shorter way of doing so, please do so..
    Thank you again,

  • Apple script to find all image files on computer and put them into 1 folder

    Is there any way to do this with apple script? Thanks

    Hi glaurung,
    Doing this with vanilla AppleScript and the Finder would take too long. There might be a way to do this with unix commands, but probably the best way to this would be to use the built in find for your system. I wouldn't search the whole computer. Maybe just search somewhere in your Home folder. Use a criteria like all files with extension jpg, tiff, tif, etc.. Then you can just drag the found files into whatever folder you want. You need to be cautious because you wouldn't want to move all files. For instance, you wouldn't want to move all pictures in your iPhoto library, other apps, or the System.
    gl,

  • Copy Illustrator contents to Indesign (Scripting) - Urgent

    Hi,
    I need to copy the contents of illustrator to indesign using scripting. Can any of you please help me to copy the contents from illustrator to indesign.
    Thnaks for help in advance

    ... Erm. What was the difference, then?
    BridgeTalk is a way to comunicate between Adobe applications -- for example, you can use it to trigger an InDesign script from Bridge to process selected indd-files (thumbnails) in Bridge. And vice versa, you can run a Bridge script from InDesign -- e.g. to get some metadata that you can't get directly from InDesign.
    Kasyan

  • Apple Script error -10006

    Hello guys, I have an big Problem with my Programm in Apple script...
    Everything of it works until a simple "duplicate" command.  Then I will get error 10006 here is the script:
    ps: I use "x" for folder name where I get "minecraft.jar"
    tell application "Finder"
      --Ermitteln des Ordner "Versionen" welcher sich im Ordner "Resources befindet"--
              set i to (path to me) as string
              set ii to (container of item i) as text
              set theFolder to (container of folder ii) as text
              set Versionen to folder "Versionen" of folder "Resources" of folder "Contents" of file i
      --Application Support definieren--
              set AppSupp to (path to application support from user domain) as text
      --Einleitende Worte für das Programm--
              display dialog "Willkommen im automatischen Versionen-Wechsel Programm für Minecraft. Bitte wählen Sie aus der folgenden Liste die Version, wechle Sie installiert haben wollen. -Ich weise darauf hin, dass die benützung auf eigene Gefahr ist."
      --Auswahl der Version--
              set liste to choose from list {"Vollversion 1.2.5", "Vollversion 1.2.3", "Vollversion 1.1", "Vollversion 1.0.0", "Beta 1.9 Pre 6", "Beta 1.8.1", "Beta 1.8", "Beta 1.7.3", "Beta 1.6.6", "Beta 1.5_01", "Beta 1.4_01", "Beta 1.3_01", "Beta 1.2_02", "Beta 1.1_02", "Beta 1.0"}
              if liste is {"Vollversion 1.2.5"} then set x to "v_1.2.5"
              if liste is {"Vollversion 1.2.3"} then set x to "v_1.2.3"
              if liste is {"Vollversion 1.1"} then set x to "v_1.1"
              if liste is {"Vollversion 1.0.0"} then set x to "v_1.0.0"
              if liste is {"Beta 1.9 Pre 6"} then set x to "b_1.9 Pre 6"
              if liste is {"Beta 1.8.1"} then set x to "b_1.8.1"
              if liste is {"Beta 1.8"} then set x to "b_1.8"
              if liste is {"Beta 1.7.3"} then set x to "b_1.7.3"
              if liste is {"Beta 1.6.6"} then set x to "b_1.6.6"
              if liste is {"Beta 1.5_01"} then set x to "b_1.5_01"
              if liste is {"Beta 1.4_01"} then set x to "b_1.4_01"
              if liste is {"Beta 1.3_01"} then set x to "b_1.3_01"
              if liste is {"Beta 1.2_02"} then set x to "b_1.2_02"
              if liste is {"Beta 1.1_02"} then set x to "b_1.1_02"
              if liste is {"Beta 1.0"} then set x to "b_1.0"
      --Ist Minecraft schon Installiert? Wenn Ja dann löschen--
              if folder "minecraft" of folder AppSupp exists then
                        delete folder "minecraft" of folder AppSupp
              end if
      --MinecraftVorlage entpacken--
              open file "minecraft.zip" of Versionen
      --Pause--
      delay 1
      --Finder Fenster schließen--
      close Finder window 1
      --Vorbereiten der MinecraftVorlage--
    duplicate file "mincraft.jar" of folder x of Versionen to folder "bin" of folder "minecraft" of Versionen.
    Could anyone say me what's wrong with this line?
      --Installieren--
              duplicate folder "minecraft" of Versionen to AppSupp
      --Pause--
      delay 1
      --Temporäre Dateien löschen--
              delete folder "minecraft" of Verionen
      --Alles Richtig?--
              if folder "minecraft" of folder AppSupp exists then
                        display dialog "Die Installation von Minecraft wurde erfolgreich abgeschlossen!" with title "MC-Installer"
              else
                        display dialog "Es ist leider ein unerwartetes Problem bei der Installation vorgelaufen." with title "MC-Installer"
              end if
    end tell
    Error msg:
    tell current application
      path to current application
                        --> alias "Macintosh HD:Users:manuelfederanko:Desktop:VersioChanger.app:"
    end tell
    tell application "Finder"
              get container of item "Macintosh HD:Users:manuelfederanko:Desktop:VersioChanger.app:"
                        --> "Macintosh HD:Users:manuelfederanko:Desktop:"
              get container of folder "Macintosh HD:Users:manuelfederanko:Desktop:"
                        --> "Macintosh HD:Users:manuelfederanko:"
              get folder "Versionen" of folder "Resources" of folder "Contents" of file "Macintosh HD:Users:manuelfederanko:Desktop:VersioChanger.app:"
                        --> folder "Versionen" of folder "Resources" of folder "Contents" of application file "VersioChanger.app" of folder "Desktop" of folder "manuelfederanko" of folder "Users" of startup disk
      path to application support from user domain
                        --> alias "Macintosh HD:Users:manuelfederanko:Library:Application Support:"
              display dialog "Willkommen im automatischen Versionen-Wechsel Programm für Minecraft. Bitte wählen Sie aus der folgenden Liste die Version, wechle Sie installiert haben wollen. -Ich weise darauf hin, dass die benützung auf eigene Gefahr ist."
      --> {button returned:"OK"}
              choose from list {"Vollversion 1.2.5", "Vollversion 1.2.3", "Vollversion 1.1", "Vollversion 1.0.0", "Beta 1.9 Pre 6", "Beta 1.8.1", "Beta 1.8", "Beta 1.7.3", "Beta 1.6.6", "Beta 1.5_01", "Beta 1.4_01", "Beta 1.3_01", "Beta 1.2_02", "Beta 1.1_02", "Beta 1.0"}
                        --> {"Beta 1.8.1"}
              exists folder "minecraft" of folder "Macintosh HD:Users:manuelfederanko:Library:Application Support:"
      --> false
              open file "minecraft.zip" of folder "Versionen" of folder "Resources" of folder "Contents" of application file "VersioChanger.app" of folder "Desktop" of folder "manuelfederanko" of folder "Users" of startup disk
      close Finder window 1
                        --> {}
              copy file "mincraft.jar" of folder "b_1.8.1" of folder "Versionen" of folder "Resources" of folder "Contents" of application file "VersioChanger.app" of folder "Desktop" of folder "manuelfederanko" of folder "Users" of startup disk to folder "bin" of folder "minecraft" of folder "Versionen" of folder "Resources" of folder "Contents" of application file "VersioChanger.app" of folder "Desktop" of folder "manuelfederanko" of folder "Users" of startup disk
                        --> error number -1728 from file "mincraft.jar" of folder "b_1.8.1" of folder "Versionen" of folder "Resources" of folder "Contents" of application file "VersioChanger.app" of folder "Desktop" of folder "manuelfederanko" of folder "Users" of startup disk
    Ergebnis:
    error "„Finder“ hat einen Fehler erhalten: „folder \"bin\" of folder \"minecraft\" of folder \"Versionen\" of folder \"Resources\" of folder \"Contents\" of application file \"VersioChanger.app\" of folder \"Desktop\" of folder \"manuelfederanko\" of folder \"Users\" of startup disk“ kann nicht als „file \"mincraft.jar\" of folder \"b_1.8.1\" of folder \"Versionen\" of folder \"Resources\" of folder \"Contents\" of application file \"VersioChanger.app\" of folder \"Desktop\" of folder \"manuelfederanko\" of folder \"Users\" of startup disk“ gesetzt werden." number -10006 from folder "bin" of folder "minecraft" of folder "Versionen" of folder "Resources" of folder "Contents" of application file "VersioChanger.app" of folder "Desktop" of folder "manuelfederanko" of folder "Users" of startup disk

    path to resource is straightforward.  the command:
    path to resource "filename.xxx"
    will return an alias to /path/to/your app/Contents/Resources/filename.xxx, automatically accounting for placement of the app file in the file system.  use the in directory parameter if you want to specify a subfolder of the resources folder.  The only tricky thing about it is that when you run the script from the script editor it may think the currently running app is the script editor, not your app, and swo return a path to script editor's resource folder.

  • Sending email using apple script...

    I have created a watch folder using apple script that when a file is dropped on it, it automatically opens, formats, and sends out a custom email.
    What I don't understand is, how can I include multiple variables in the "content" section (also known as the body section of the email)? I want to put custom type in the content section that says "There is a file awaiting your review." I also would like to choose an email signature from my mail program to use. Third, I would like to include the name of the file that is being sent....
    I found that by doing {content:iteminfo} I could get the file name...If I do {content:"There is a file awaiting your review."} I could get the custom type I wanted....
    BUT, I can't figure out how to get BOTH of them together in ADDITION to adding a custom email signature...
    I know there are some really smart people out there...Any tips?

    I can't figure out how to get BOTH of them together
    This is just standard AppleScript text concatenation with the &:
    ... {content: "There is a file awaiting your review: " & iteminfo}
    Here you can see I'm concatenating a literal string (enclosed in quotes) and a variable. You can extend this ad infinitum.
    As for the signature:
    tell theMessage to set message signature to signature "My Sig"
    (which assumes you have a signature named 'My Sig'. Adjust as necessary.

Maybe you are looking for