How to script File Menu "Create Archive of..."

I have been trying to script the File Menu's "Create Archive" command but i can't figure out how to add the quote characters around the items name when only one item is selected for archiving. I have tried the escape character but applescript errors on it. I can get it to work if I use menu item number, but that varies by system.
here is what I have so far.
try
tell application "Finder"
activate
select item "PicaX4:BackUp:"
end tell
tell application "System Events"
tell process "Finder"
-- create archive
click menu item "Create Archive of \"BackUp\" " of menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
on error errMsg
end try
on a related topic, how do I wait for the completion of the archive process so I can then do something with the zip file?
any feedback would be greatly appreciated.
thank you, greg

Since 'Create archive' basically creates a .zip file, it would be far easier to use a shell script to do this:
do shell script "/usr/bin/zip -r /Volumes/PicaX4/BackUp.zip /Volumes/PicaX4/BackUp"
If you still want to take the UI approach you should note that the menu item uses 'smart' quotes “and” and not the regular quotes.

Similar Messages

  • Using an SQL Script file to create database in Java? (monkeyDB.sql)

    Hello!
    I am a writing an SQL Script so that I can re-create my database on another server (im using my laptop to test it on first though).
    I'm connecting to mySQL server using JDBC which works fine, but I was wondering
    how can I run an entire script file, say myScript.sql from within a Java class??
    (an SQL Script is simply a file containing the regular SQL commands and expressions that you might enter at an sql command line prompt)
    example of an SQL Scritp: monkeyDB.sql>>
    //#create new db
    CREATE DATABASE sample_db;
    //#set active db
    USE sample_db;
    //#set table paramaters
    CREATE TABLE monkeys
    (name CHAR(20),
      age INT UNSIGNED,
      sex ENUM('M','F')
    //#create standard monkeys
    INSERT INTO monkeys(name,age,sex) VALUES("Sammy",10,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Muncht",12,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Jill",8,"F");
    //#get recordset
    SELECT * FROM monkeys WHERE age < 50;Thanks for your help!

    thanks. :-)
    I thought about that too but I didnt want to hard wire it into the code.
    I guess it isnt possible to output the script file using some command from the sql library..?

  • Corrupt (?) zipped files from "Create Archive"

    I am repeatedly having trouble with files I zip using "create archive." Whether it's fonts or images, the recipients are not able to use the files I send (they seem to uncompress, but aren't readable). This is happening often enough that I wonder if there is a problem with the software. I didn't find this question asked when I did a search.
    thanks!

    Hi, casperr. Welcome to the Discussions.
    1. Are the recipients using Windows? If so, you may want to purchase a copy of StuffIt Deluxe, which can create archives that are both Windows-friendly and self-extracting.
    2. Have you tried opening the archives you have created with Create Archive to see if the contents of the archive you've created are AOK before sending them? That will help you determine if the problem is on your Mac, with the transmission, or a problem on the other user's computer.
    3. You might want to enquire as to how the recipients are unzipping the archives you have sent that they are finding problematic.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How  pass script file  in XI?(please help)

    hi all
    i have a scenario where i have to get data from r/3 as well have to pass script file kept in R/3 or XI  but script file is not SAPscript  a custom developed script.Input to XI will be data as well script file so  there are two datasources  getting input one is R/3 and other is script file and the output will contain a single xml file containing script and data from R/3.so my question is how to combine  two input sources using  different adpters rfc and file into one output format
    please do help in this context .
    please
    with regards
    subrato kundu

    Hi subrato,
    you can solve that with or without (<a href="/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible">Multi-Mapping without BPM - Yes, it’s possible!</a>) BPM
    In the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">SAP library</a> is a example for merging message with BPM.
    Regards,
    Udo

  • How to attach files while Creating shopping cart using FM- BBP_PD_SC_CREATE

    Hi
    I am trying to create shopping cart from R/3 system using RFC calls to FM's BBP_PD_SC_CREATE, BBP_PD_SC_SAVE & BBP_PD_SC_COMMIT.
    Also I have to attach files as we do in Standard SAP shopping cart creation process..
    But I see a parameter IT_ATTACH to pass the attachments in the FM - BBP_PD_SC_CREATE..Is that the right one to use? If yes, can you suggest the values to be passed in the same if you have done this before..
    Thanks
    Geetha
    Edited by: GEETHA VASUDEVAN on Apr 20, 2009 6:17 PM

    Hi
    I am trying to create shopping cart from R/3 system using RFC calls to FM's BBP_PD_SC_CREATE, BBP_PD_SC_SAVE & BBP_PD_SC_COMMIT.
    Also I have to attach files as we do in Standard SAP shopping cart creation process..
    But I see a parameter IT_ATTACH to pass the attachments in the FM - BBP_PD_SC_CREATE..Is that the right one to use? If yes, can you suggest the values to be passed in the same if you have done this before..
    Thanks
    Geetha
    Edited by: GEETHA VASUDEVAN on Apr 20, 2009 6:17 PM

  • How to create several procedures from several script files?

    Hello,
    I have several procedures for SAP HANA. Every procedure is stored in a script file. I can only use SAP HANA Studio.  How can I easily  run all script files to create all procedures on a schema? Can somebody help me?
    Best regards,
    Y.Hu

    Hi Fernando,
    Thank you very much for you explanation.
    My scripts contain native sql statements for creation stored procedures “CREATE PROCEDURE … AS BEGIN … END”. They are not objects for or from Content/package. The procedures should be created direct in a project schema.
    The option with hdbsql command line is not possible because I may not use hdbsql (unfortunately not allowed for me).
    The option all scripts into a big file is a possible option for me. The big file has only 1600 lines. But there is a  strange problem with the text “FOR” in script (please see the thread http://scn.sap.com/thread/3728741 ). Unfortunately SAP HANA Studio cannot run my big script. 
    I hope there is a solution or workaround for this problem.
    Best regards,
    Y.Hu

  • Why isn't Create Archive working for dv file?

    I have a 9GB dv file that I like to archive. I highlight the file and "create archive". A .zip file is created immediately, but when I check the file, it is zero byte length. I tried with another file which is a small .pdf file, a valid zip file was created for me. Looks like I did the right thing, but the software didn't. I used Apple help, it suggests checking permission. I have read write permission on the file and its containing folder.
    Any suggestion? Can a .dv file file achived in the first place?

    It turns out not the file size. I later found out that the archive does not start until like 5 minutes after the empty zip file is created. It estimates that the 9GB will take 22 hours to compress. I guess the 5 minutes delayed response is also due the slow CPU of my old G5 iMac.
    Thanks anyway.

  • [CS5] InDesign Server holding onto script file after being executed?

    Hello,
    I've run into a scenario which we have a script file dynamically created, saved to disk, then sent to InDesign Server to be executed. The code that tells InDesign Server to execute the script will delete that script file after it's finished executing. This works MOST of the time. However, sometimes, we get IO Execeptions stating that the file cannot be deleted because it is still in use. It would appear that InDesign Server is possibly holding onto the script files maybe even for just a millisecond after it's finished executing.
    Has anyone experienced anything like this before? I'm looking for possible things to check (maybe it's not even ID Server that is the problem). Or maybe there is some option within ID Server when executing scripts that would allow ID Server to remove the file instead of our .NET code?
    Any advice/suggestions greatly appreciated, thanks!
    -lhanneman

    UPDATE:
    It appears that this problem is related to IDS executing the script. I've narrowed the problem down by taking the script execution completely out of the equation. If my code saves the script to disk and attempts to delete it right after - it works every time. I'm also able to, within our .NET code, save the script to disk, open the file up, read a line out, close it, and then immediately delete it. ONLY when ID Server executes that script between writing the file and deleting the file do we have problems.
    Has anyone ever encountered anything like this? It seems to be directly related to ID Server holding onto the file for too long.
    Again, many thanks in advance for any help!
    -lhanneman

  • Script Files

    Dear All
    I am working on Oracle Forms 9i. I have Oracle University Books with me. I want to practice the exercises given in the courseware. Kindly tell me where do I get the script files to create the practice tables.
    Thanks in advance
    Badari Hareesh

    the Oracle University Scripts are not free to download for Students. Only at the courses you can use them

  • Cloning 10g Database in archive mode - How add new created archive files

    Deat all
    I want to clone oracle 10g database using hot backup. database in archive mode.
    Database is running user data entry contifue, during hot backup there are aproximatly 3 to 5 new archive log created. Please guide me how add these new created archive log in cloning process.
    Thanks
    Alter system switch logfile;
    SQL> select max(first_change#) scn from v$archived_log;
    SCN
    8592924
    alter tablespace tablespace1 begin backup;
    alter tablespace tablespace2 begin backup;
    alter tablespace tablespace3 begin backup;
    alter tablespace tablespace1 end backup;
    alter tablespace tablespace2 end backup;
    alter tablespace tablespace3 end backup;
    select name from v$archived_log where first_change# >= 8592924 order by name
    NAME
    F:\ARCHIVELOGS\ARC00390_0664080689.001
    F:\ARCHIVELOGS\ARC00391_0664080689.001
    F:\ARCHIVELOGS\ARC00392_0664080689.001
    create pfile='init<new database sid>.ora' from spfile;
    alter database backup controlfile to trace as '/home/oracle/cr_<new sid>.sql'
    STARTUP NOMOUNT
    CREATE CONTROLFILE SET DATABASE "ORCL" RESETLOGS FORCE LOGGING NOARCHIVELOG
    MAXLOGFILES 50
    MAXLOGMEMBERS 5
    MAXDATAFILES 100
    MAXINSTANCES 1
    MAXLOGHISTORY 453
    LOGFILE
    GROUP 1 'E:\oracle/oradata/dg9a/redo01.log' SIZE 100M,
    DATAFILE
    Edited by: Naeem Sheeraz on Nov 15, 2008 12:54 PM

    When you attempt to startup the cloned database on the new server you will find that it needs recovery -- because it was taken in hot backup mode.
    That is why you need to copy the archivelogs that are generated from the first archivelog after the first "alter tablespace begin backup" to the first archivelog after the last "alter tablespace end backup".
    I see that you are also including a CREATE CONTROLFILE script.
    You would run that at the cloned environment.
    Then you would issue the RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL command to make the clone consistent.
    You can, of course, use the same method to copy these archivelogs as you use to copy database files -- tar, cpio, tape, etc.

  • Create Archive, how to change the behavior of the default file naming?

    From an earlier post on archiving via the contextual menu in the Mac OS X Finder:
    "If you archive a single item, the archived file has the name of the original item with a ".zip" extension. If you archive multiple items at once, the archived file is called Archive.zip."
    Is there a way to change the behavior of this?
    I ask because I want to archive a single file, say "photo.psd" and when I do I get an archive called "photo.psd.zip" - is there a way to create an archive from the contextual menu and have the original file extension be appended? - in this case I would want "photo.zip" to be the end result.
    Also, is there a way to change the behavior of archiving multiple files? To, say, create a differently named file afterwards instead of the default "Archive.zip" - perhaps something a little more descriptive but standard, like "YourFilesCompressed.zip" - something that would stay the same across each archive creation.
    Thanks, I've been manually renaming after all create-archive's. And I do realize other applications could probably do this, but I'm thinking there must be a way to do this in the finder, no? A terminal command? Any ideas would be appreciated.

    Try looking at the documentation for the ditto and zip Terminal commands.
    (14504)

  • Can't create archive from file menu

    Hello,
    I can't create 'archive' (tar.gz) from file menu in Color (Save Archive As...).
    I don't have authorization problem on my folder project; i can create myself a tar.gz archive in the folder Archive of my Color's project.
    The system.log file said:
    Jul 16 09:45:51 fcp1 [0x0-0x1e01e].com.apple.color[215]: tar: Cowardly refusing to create an empty archive
    Jul 16 09:45:51 fcp1 [0x0-0x1e01e].com.apple.color[215]: Try `tar --help' or `tar --usage' for more information.

    some other users report difficulties, crashes, freeze-ups and very long save times associated with the Operating System and Finder. There is apparently some background file compression utility that may be interfering with your save routine. There are a couple of threads related to this issue on this forum, so a bit of searching may yield a solution.
    I haven't encountered it in nearly four years of day-to-day with three separate systems in either Tiger or Leopard. Suffice to say that if you have any third-party whiz-bang utilities running, COLOR is very vulnerable to OS corruption as it is a stripped-out race car that doesn't expect or tolerate much else when it comes to sharing the computer.
    jPo

  • How do i create "Save As" option to file menu in Numbers version 2.3 (554). I have done this previously but cant remember how its done. My OS is 10.9.3

    How do i create "Save As" option to file menu in Numbers version 2.3 (554). I have done this previously but cant remember how its done. My OS is 10.9.3

    You can follow the steps in this article on TUAW to change the five-key shortcut for Save As… to the old tthree-key shortcut.

  • How to create file menu in the swing?

    How to create file menu or any menu in the swing?
    Please help me.

    How to create file menu or any menu in the
    swing?
    Please help me.By file menu, do you mean where you can choose a file to open or save to? If so, have you had a look at the File Chooser component? If not, please click on the link in the previous sentence to the Sun tutorial.
    Good luck
    /Pete

  • How to customize or create new file menu items in Adobe Illustrator CS 6?

    Hi all,
    I have developed a script to perform some Custom action in Illustrator. I want to make this script run from a a File Menu Item so it can be invoked easily. Is there a way to customize Illustarator to add a new menu item or modify the existing menu tems functions. For example if the script needs to be invoked when the user click "Save" is there a way that could be done.
    Thanks

    Thanks Mark,
    When you mean by limited menu location does it mean a plugin could be added under "File" as options or AI only allows it under "Window" where you launch the plugins from normally.

Maybe you are looking for

  • Report for Vendors

    Hello Friends, I want one report for vendor for which, Opening Balance, Debit and Credit Totals and Closing balance will be showing. Additional Fields will be Reconciliation Account, Posting date from 01.05.2007 to 29.02.2008. Our financial period is

  • OSX 10.8 Install issues.

    I don't understand why this is so difficult for me. I'm having a problem upgrading to Mountain Lion from Lion on a MB Air. I've done almost everything except wipe, and renew, which i cannot do, because I don't have a Lion install disk. Here's what I'

  • Special attribute "image" doesn't seem to work with "progressbar"...

    hi all ! I'm using special attributes of the plug-in (http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/special_attributes.html) to customize its look while loading. I noticed that when I use the "image" attribute, it works fine, but i

  • Resetting the transaction figures of an account

    Hi Is it possible to reset the transaction data for one master record/account alone. I know that the TCode OBR1 would reset data, but for the entire company code. How can I reset the transaction data for one account - say a vendor account? Thanks in

  • HT201272 Is there any way to transfer game saves and level data between devices without jailbreaking?

    I've had a 4s for a couple years and have quite a few games. I would like to tranfer in game data levels to my new iPad mini so I dont have to restart them from the beginning. Is there anyway of doing this without jailbreaking and messing around with