Help with a script (what am I doing wrong)

tell application "Finder"
set theFolder to (choose folder with prompt "choose the user folder") as Unicode text
set newFolder to make new folder at theFolder as Unicode text with properties {name:"test folder"}
set targetFolder to newFolder
move entire contents of (theFolder & "Library:Preferences") to targetFolder
end tell
error "Can’t get entire contents of \"Macintosh HD:Users:username:Library:Preferences\"." number -1728 from «class ects» of "Macintosh HD:Users:username:Library:Preferences"
also I would like the new folder in Library not user folder

I had some time to give the connected volume stuff another look, so I tweaked the script a little. This latest version will handle getting the users from local or connected volumes as well as connected accounts. I threw in some labels in the choice dialog so you can see what the volumes are, and changed the time stamp a little to avoid using either the POSIX or Finder path delimiters.
<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 the Script Editor">
-- remove user preferences to a backup folder
set theUsers to {}
repeat with aDisk in (get list disks)
set aDisk to contents of aDisk
tell application "System Events"
if (local volume of disk aDisk) then -- get users from local disks
if (startup of disk aDisk) then
set label to "[Startup Volume] "
else
set label to "[Local Volume] "
end if
repeat with aUser in paragraphs of (do shell script "ls '/Volumes/" & aDisk & "/Users'")
if aUser is not in {"Shared"} then set the end of theUsers to (label & aDisk & "/Users/" & aUser)
end repeat
end if
try
if (server of disk aDisk is not missing value) then -- get users from connected disks
try
repeat with aUser in paragraphs of (do shell script "ls '/Volumes/" & aDisk & "/Users'")
if aUser is not in {"Shared"} then set the end of theUsers to ("[Server Volume] " & aDisk & "/Users/" & aUser)
end repeat
on error errmess -- get connected user
log errmess
set the end of theUsers to ("[Server " & (server of disk aDisk) & "] " & aDisk)
end try
end if
end try
end tell
end repeat
set theChoice to (choose from list theUsers with title "Move preferences to backup" with prompt "Select an account to move user preferences:" with empty selection allowed) as text
if the result is in {"false", ""} then return -- no selection
set theChoice to "/Volumes/" & text ((offset of "] " in theChoice) + 2) thru -1 of theChoice -- strip off the volume labels
set theSource to (theChoice & "/Library/Preferences") as POSIX file as text as alias
set theDestination to (theChoice & "/Library") as POSIX file as text as alias
tell ((current date) as «class isot» as string) to set timeStamp to (text 6 thru 7) & "-" & (text 9 thru 10) & "-" & (text 3 thru 4) & space & (text 12 thru 13) & (text 15 thru 16) -- ISO time = yyyy-MM-ddThh:mm:ss
set theName to "Preferences copy " & timeStamp
try
set targetFolder to ((theDestination as text) & theName) as alias
on error errmess
log errmess
tell application "Finder" to make new folder at theDestination with properties {name:theName}
set targetFolder to the result as alias
end try
tell application "Finder" to move items of theSource to targetFolder
</pre>

Similar Messages

  • AppleScript to call a Photoshop Script: what am I doing wrong?

    Hi All.
    I'm using AppleScript to try and call a photoshop Java script stored in my *** project.
    The basic set up is:
    Tell Application Photoshop CS3
    set myscript to POSIX path of ((path to me as Unicode text) & "Contents:Resources:Equipment_ProductSilosthumb.js")
    do javascript myscript
    end tell
    when i try and run the script i get the following error
    - Error 25: Expected: ;.
    Line: 1
    -> /Users/amannone/Production Tools CS3/build/Debug/Production Tools.app/Contents/Resources/Equipment_ProductSilosthumb.js (8800)
    If i embed the script in the apple script it will work ok.
    ie do javascript "insert js code here"
    What am I doing wrong?
    Software: Adobe CS3 Extended, Mac OS X 10.5, Xcode 3
    Thank for the help.
    -andrew

    Your description of the issue is not clear:
    What format, bit depth and color was your original file "from the net"?  It sounds like it was a Color Indexed GIF, which would cause what you are describing.
    In the Macintosh Finder, select said "net image" and do a Get Info on it (Command+i). When the Info box appears in the Finder, take a screen shot and upload it here by using the little camera icon in the Reply Editor in the forum's web interface.
    If the image is a 256-color GIF, remember the rule:  GIGO = garbage in, garbage out.

  • Message "this app is not compatible with this iPad" What am I doing wrong?

    I am trying to update my apps and when I touch update all I get the message 'this app is ot compatible with this I-pad.  this has never happened before, what am I doing wrong?

    One or more of the apps you are updating is seeing that you have not yet gone to ios5.  All the iwork app changes, for example, will not upgrade until you do.   What you can do is tick them individually.  If that particular app will update, then it will.  If it won't it will tell you, and you can go back and get them later after you do the ious 5 update.  Last night i decided to update before i started the ios 5 upgrade, and there were 16 apps waiting for up date.  All but 5 did update, but not the i works, and 2 others.
    It takes a little longer to do them 1 at a time, but it is better than staring at the stupid 'not eligable' notice.

  • Attempting to test Function with Bind Variable --- What am I doing wrong?

    When I try to test a function (ComputeFreight) with a bind variable, I get an error, returned.....
    "SQL> EXEC :ComputeFreight :=V_ComputeFreight;
    BEGIN :ComputeFreight :=V_ComputeFreight; END;
    ERROR at line 1:
    ORA-06550: line 1, column 25:
    PLS-00201: identifier 'V_COMPUTEFREIGHT' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored"
    What am I doing wrong?
    Below is my code with description ----
    create or replace function "ComputeFreight"(p_ORDERNUMBER IN C_ORDER.ORDERNUMBER%TYPE) -- Passing Ordernumber into Function
    return NUMBER
    is
    -- Declaring Variables
    v_ComputeFreight NUMBER(10,2);
    v_low number (10,2) := 0.05;
    v_high number (10,2) := 0.07;
    v_SUBTOTAL NUMBER(10,2);
    begin
    -- Computing order subtotal (Retrieving Item cost and qty from two different tables, multiplying and adding total order cost)
    SELECT SUM(O.QUANTITY * I.ITEMPRICE) INTO v_subtotal
    FROM ORDER_LINE O JOIN INV_ITEM I
         ON (O.ITEMNUMBER = I.ITEMNUMBER)
    WHERE O.ORDERNUMBER = P_ORDERNUMBER;
    -- Testing to see which freight charge rate to use
    IF
    v_subtotal < 300.00 THEN
    v_computefreight := v_subtotal * v_low;
    ELSE
    v_computefreight := v_subtotal * v_high;
    END IF;
    -- Returning Freight Charge
    RETURN v_ComputeFreight;
    end "ComputeFreight";
    -----------------------------------

    You have made at least 2 errors.
    The first one is the name of your function:
    create or replace function "ComputeFreight" (You use double quotas and the mixed case in the function name - it means you
    make your function name case-sensitive. In the call of your function you have to use double-quoted form "ComputeFreight", nothing else.
    If you your function name has to be case-insensitive, don't use double quotas or
    use upper-case form: "COMPUTEFREIGHT".
    The next mistake is how your call you function. You have to do the following:
    var V_ComputeFreight number
    EXEC :V_ComputeFreight := <your function name>
    V_ComputeFreight is a bind variable and you have to read more about this.
    Rgds.
    P.S. and as Dave fairly remarked above you have to pass the argument into the function.
    Message was edited by:
    dnikiforov

  • Iphoto.  When I play an album "slideshow" some photos show up as a blank/black screen.  Please help if you know what I am doing wrong.

    Iphoto Question
    When I playing a "slideshow" album, a few photos show up as a blank screen.  Also, when I select a photo in an album to make it full screen - some photos won't "hold" - they go full screen for about a second, then the screen goes blank.  Any ideas about what I am doing wrong?  Thank you.

    There are several possible causes for the Black Screen issue
    1. Permissions in the Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to check and repair permissions.
    2. Minor Database corruption: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). (On iPhoto 11 this option is under the File -> Reveal in Finder.) Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
    4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/ Library/ Caches...
    5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    If none of these help: As a Test:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • HT204053 Trying to set up my apple TV and it doesn't want to accept the Apple ID and password I have just set up with iTunes.  What am I doing wrong?

    I am having trouble signing into my apple ID acct on my new device Apple TV.  It doesn't seem to accept my newly created  Apple ID and password.  What am I doing wrong?  Is there a delay in creating the acct to when I can use it?

    yeah have reguested apple id and reset password still nothing

  • Help with board etiquette, what am I doing incorrectly?

    please

    One idea:  It is customary to put your question in as much detail as possible in the body of the posting and not just rely on the subject line.   Many responders will want to quote part of your question to make it clear what and whom they are answering, and you can only quote from the body.
    Also it is important to try to choose the correct forum.  It is hard to see what your question has to do with the iBooks app.  But there is a forum for general board questions here:
    https://discussions.apple.com/community/using_apple_support_communities

  • [SOLVED] SSH Log check script, what am i doing wrong?

    wow linux, you never cease to amaze me
    cat /var/log/auth.log | grep -vP "(209\.94\.131.\65|216\.204\.172\.218)" | grep Accepted | awk '{ print $1, $2, $11 }'
    --- the rest is immaterial --
    disclaimer: i am a horrible scripter; i'm just learning; there's probably a better way to do this
    what i'm trying to do: cat through /var/log/auth.log for accepted ssh connections, filter out my home and work ip's, place any filtered ip's in a log file with date.
    i'm having some trouble when checking for inequality between two ip strings (xx.xx.xx.xx).  this script:
    #!/bin/bash
    homeip=`whatismyip`
    workip="216.204.172.218"
    log=${HOME}/Documents/ssh_log
    logip=`cat /var/log/auth.log |
    \grep Accepted.*patrick |
    \awk '{ print $11 }'`
    if [ "$logip" != "$homeip" ]; then
    if [ "$logip" != "$workip" ]; then
    echo -e "$logip \n"
    #cat /var/log/auth.log | grep "$logip" | awk '{ print $1 " " $2 " " $11 }' > $log
    fi
    fi
    echo Home\:\ $homeip
    echo Work\:\ $workip
    exit 0
    outputs this:
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    192.168.0.7
    192.168.0.7
    192.168.0.7
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    68.37.60.140
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    216.204.172.218
    192.168.0.7
    216.204.172.218
    209.94.131.65
    209.94.131.65
    216.204.172.218
    209.94.131.65
    216.204.172.218
    Home: 209.94.131.65
    Work: 216.204.172.218
    i have it just echoing the ip's it finds in the log, then showing which ones _should've_ been filtered out, to debug.
    what gives?
    i'm sure it's trivial, any help would be appreciated.
    Last edited by brisbin33 (2009-01-13 17:10:10)

    pointone,
    yes, you're exactly right, i was thinking one grepped line at a time, not the whole string... that'll require a rewrite
    rson,
    grep -vP and awk should do what i want w/o any scripting required... think i'd learn by now, RTFM right?

  • Photos from Win XP will not Sync with 3G iphone what am I doing wrong

    Need some help, just got the iphone and the only thing I can't understand is how to transfer my photos from my PC to the phone. I understand I use Itunes and point it to the folder/photo I want to sync. Itunes goes through it optimizing 1 of 29 photos (only doing 29 photos to start) but then when I go to the phone I have the normal Camera Roll Album and one folder listed. In the folder listed is only one photo which is all messed up.
    I understand the phone takes photos and displays photos at one res, and I thought Itunes doesn't care what res the photo from the PC is cause it optimizes it to be viewed on the phone.
    What am I missing ? and what is this folder that keeps being built ipod photo cache. Any help would be wonderful and yes I did read the "Iphone User Guide" that came with the phone.

    Not sure what the issue is that you are having. Sounds like you are doing the right thing.
    You point iTunes to a folder that contains pictures (or more subfolders that contain pictues...1 subfolder deep). Then tell it to sync. iTunes does its "optimize" thing. Then they sync over. Each subfolder in that folder you pointed to becomes a library.
    eg:
    C:\PHOTOS you point it to.
    C:\PHOTOS\FAMILY
    C:\PHOTOS\WORK
    C:\PHOTOS\FRIENDS
    C:\PHOTOS\WALLPAPER
    C:\PHOTOS\MISC
    are all under it.
    Each of those becomes a library on the iPHone (Family, Work, friends, etc)
    Photos from those folders go to phone (and photos from the root you pointed it to).
    The extra folder it makes (think it tries to mark it hidden unless you have it set to show hidden files) is just stuff for iTunes to keep track (like HASH data and other stuff) to know what it has synced so it can tell what is new and what is old if you add more photos or folders later.
    I have some huge images on my PC that I sync over without issue. iTunes scales them down when syncing to the phone (the whole optimize stuff).
    Message was edited by: DaVBMan

  • Cannot set up Mail with GoDaddy Account, what am I doing wrong?I

    I searched the correct way to do this through GoDaddy, my hosting service and got these directions, which I have tried, but didn't work.
    *To Set Up Apple Mail for SMTP Relay
    1. From the Mail menu, click Preferences.
    2. In the Preferences window, click Accounts.
    3. In the Account window, click Account Information.
    4. From the Account Type list, select POP.
    5. In the Description field, type a name for the account.
    6. In the Email Address field, type your email address.
    7. In the Your Name field, type your full name.
    8. In the Incoming Mail Server field, type pop.secureserver.net.
    9. In the User Name field, type your user name (your full email address).
    10. In the Password field, type the password to your email account.
    11. In the Outgoing Mail Server (SMTP) field, type smtpout.secureserver.net.
    12. In the SMTP Server Options window, in the Outgoing Mail Server field, type smtpout.secureserver.net.
    13. In the Authentication field, type your password.
    14. In the Server Port field, type 80 or 3535.
    15. In the User Name field, type your SMTP user name.
    16. In the Password field, type your SMTP password.
    17. Click OK.
    Obviously, I'm connected to the internet...
    I tried doing this through POP and IMAP, there is an error message saying unable to connect. What can be done to make this work?

    the 3535 is not gonna work...the 110 will work...I have been dealing w/ godaddy.com .mac and mac support for 5 months with compatibility. It is the worst.. mac says they never heard of godaddy and godaddy had me run a trace route so then I had to deal w/ my isp for no good reason since other browsers could reach godaddy so it is not my stream.. It is the worst. These are suposed to be the easiest and most seemless systems and they cannot sync. I use firefox to get to go daddy on my macbook and it is as if I am using dial up. I am ready to just cancel .mac which is really another headache to learn..and godaddy and just move everything over to a company that can handle everything. My web business has been on hold since January. It makes no sense. I got the mac so I would not have to deal w/ the windows registry error answer.. now godaddy tells me they are built for windows.
    There is no winning at this. I have spent countless hours on phone support after spending countless hours researching the answers only for all support lines to tell me i can "go to...website for more info..." it is as bad as using windows.
    Very dissatissfied,
    p

  • Replacement Ipod Dead With Same Problems, what am i doing wrong?

    I bought a Classic, it started to not play some of my songs, then it crashed, then i couldnt revive it or put anything on it, so i sent it back and received a new one promptly. Guess what, same problems, stopped playing some songs about a week ago, HDD makes strange sounds as if trying and failing to locate tracks, then i did a restore after i reworked my itunes library and now the pc is starting to not recognize it and cant add songs and restoring is a pointless option, ipod is full of songs up to the letter G after a failed library sync. PlEASE help me remedy so that i dont have to replace my replacement with another ipod that needs to be replaced

    Ok here's what I did:  While the modem was still connected to my PC, my router was plugged in and just had power so I did the hard reset like you said.  Then I plugged the modem into the router, reset my modem and plugged the ethernet cable back into my tower and Now it works.  The only problem is that I have is that when i get to http://198.162.1.1/ and leave username blank and password admin, I keep getting 401 Unauthorized.  I would really like to be on a secured network but I never could because the easylink advisor wouldn't work right and I couldn't get the laptop to get connected.  Thank you for your help.

  • Some websites do not display properly. I am getting overlapping of menu's. This does not happen with IE. What am I doing wrong?

    I log on to the same wesite on Mozilla and IE. On mozilla the left hand menu overlaps one over the other but the same does not occur with IE, I ask this as I prefer mozilla. Do I need to change any configuration setting. I have a Dell Studio Laptop which is only about 5 months old. Unfortunately I cant post the url because it needs a password to get into the site.

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)<br />
    See http://kb.mozillazine.org/Zoom_text_of_web_pages
    If you increased the minimum font size then try the default setting 'none' as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    * Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"
    See also [[Websites look wrong]

  • Trouble with  vst pluggin, what  am i doing wrong??

    trying to place vst plugs , i added to the folder , but nothing??? anyone can set me in right direaction , im clearly doing something wrong

    ...additionally...
    Many VSTs are available as AUs.
    Another tip:wrappers exist. Wrappers allow most of your VSTs to load as AUs-use AUs if they are available.
    Find a wrapper here:
    http://www.fxpansion.com/product-auadapter-main.php

  • HT1414 My generation 1 iPad won't update even when I try manually with iTunes.  What am I doing wrong?

    So I have tried updating in settings and iTunes and nothing any suggestions?

    If you have the 1st gen iPad you cannot update via the settings unless you have iOS 5 on it and that is as high as you can go anyway - actually 5.1.1 is the limit.

  • I am trying to download firefox to my android and get this meesage" there are no android phones associated with this account " what am I doing wrong?

    I would like to sync my laptop and android but get the above message

    To install Firefox from the Android Market web site, you must be logged in to the web site and your phone using the same Google account. If that doesn't work, you can follow the instructions here for other ways to install Firefox for Android: https://wiki.mozilla.org/Mobile/Platforms/Android

Maybe you are looking for

  • Disappear programs of my kmenuedit

    After that I installed new glibc, disappear of my kdemenu a lot of programs like openoffice, gimp, inkscape, firefox, pidgin etc. I use KDE. It possible recover all of programs lost in menu by replace the file with new configs by file with older conf

  • Logic X Instrument Library: To Alias or Not

    Hey, guys.  I'm not a pro when it comes to DAW's, so please bear with me. I see that there are a few threads on moving Logic X's instrument libraries to an external drive.  My understanding is that this will allow Logic to read and write simultaneous

  • I have an Apple 3GS phone. How can I record a telephone call?

    I have an Apple 3GS phone. How can I record a telephone call?

  • IS IT POSSIBLE TO MANAGE AUTHORITY TO MODIFY A FIELD INTO THE GL ACCOUNTS?

    Hi everyone, I´d would like to know if It´s possile GIVE AUTHORITY to some users will be able to modify the field  SKB1 - ALTKT  into the G/L Account Master Data through transacction FS02. In this way, only the selected users could introduce or modif

  • Why is my Thunderbird connection 'timed out'?

    I am new to Mozilla Thunderbird. And am not very savvy with computers. I have gone through all the settings and made sure all the ports etc are correct. In the top left hand corner where the email address [email protected] is displayed, there is a pa