How to move an aliased based library using AppleScript

I wanted to move all my pictures from one disk (NAS) to a external disk (Device) directly connected to my Mac. This to improve access speed of all my media.
Since I have set up my library as a reference library iPhoto has created Alias to all my pictures on my NAS disk. As I want to move I need to change these alias to point to the new Device disk.
I could have imported all my pictures again, but then I would have lost all my albums. I did not look forward in re-organizing 15K in pictures. Looking into various discussions on different forums I created this Apple Script. I struggled a lot to egt the correct syntax and commands, used some stuff form other posts, thanks for this!
For every alias in a certain directory it creates a new alias with the same name however pointing to the pictures on my Device Disk. It deletes the old alias and renames the new alias to the original name. I am not sure if this is a smart thing to do, but it seems to work fine.
set f to choose folder
ProcessAlias(f as string)
-- replacess all alias files in the passed folder path (string)
on ProcessAlias(this_folder)
-- get list of folders in this_folder
set utid to AppleScript's text item delimiters -- store old delimiters
set AppleScript's text item delimiters to {return}
tell application "Finder"
set folder_listing to every folder of folder this_folder as string
end tell
set AppleScript's text item delimiters to utid -- restore old delimiters
if folder_listing is "" then
set folder_list to {}
else
set folder_list to paragraphs of folder_listing
end if
-- process folder_list
repeat with sub_folder in folder_list
ProcessAlias(sub_folder) -- send each folder back to this subroutine
end repeat
-- get list of alias files and process them
tell application "Finder"
set alias_files to every file of folder this_folder whose kind is "Alias"
repeat with this_alias in alias_files
set origitempath to original item of this_alias as text
--display dialog origitempath
set orig_name to name of this_alias
set AppleScript's text item delimiters to "NAS"
set textitemlist to every text item of the origitempath
set AppleScript's text item delimiters to "Device"
set newitempath to the textitemlist as string
set AppleScript's text item delimiters to " "
set newalias_file to make new alias file at this_folder to new_itempath
delete this_alias
set the name of newalias_file to orig_name
end repeat
end tell
return -- you can return a listing of moved originals if you want
end ProcessAlias
When running this scrip make sure you make a backup of your iPhotoLibrary.

Welcome to the Apple Discussions.
I could have imported all my pictures again, but then I would have lost all my albums.
You can convert your referenced library to a managed one. Use AliasHerder to replace the alias file in the library with their source files thus converting the library to a managed library.
Also send a feature request to Apple for better ways to use a referenced library and use NAS drives. The more requests the better.
Keep us posted as to the reliability of your method. The upside to all this is that if you run into problems later on you won't lose your source files, only the organizational effort you've put into the library.
OT

Similar Messages

  • How can I access the iphoto library using windows pc? Upgrading to aperture solves my problem?

    How can I access the iphoto library using windows pc? Upgrading to aperture solves my problem?
    My home network is used both by my macbook and my wife's windows pc. Considering that, I would like to know if we can share our pictures with each other (specially because I intend to store all of them into a NAS storage - WD My Cloud, probably).

    No you can not - neither iPhoto nor Aperture has any cross platform capability
    You can share photos with the PC using MyPhotoStream or Shared PhotoStreames
    You can not share the iPhoto library
    And you can not put the iPHoto library on a NAS - it MUST always be on a volume formatted Mac OS extended (journaled) and mube on a fast wired local connection - it can not be on a Network
    There are Digital Asset Managers that can do what you want - iPhoto and Aperture can not
    LN

  • How do i restore my iTunes library using time machine

    how do i restore my iTunes library using time machine

    Quit iTunes if it is open.
    "Enter Time Machine", navigate to the backup you wish to restore, select your Music folder, then select the iTunes folder within it, and click Restore.

  • How to move photos from one library to another?

    Hi,
    I currently have 2 libraries and I want to move photos from one library into the other.
    How do I have to proceed?
    Thx
    A

    We're thinking of adding a library copy feature soon.  Hoping you can share some info here to help us understand how this might best work fo you.   Here's a few questions I have:
    - What do you use the 2 libraries for?
      - Why do you want to copy?
      - Do you have albums, favorites, and comments associated with the photos?  Do you want them copied?
    Anything else that you are hoping to accomplish here?
    Thanks in advance,
    Peter

  • How to move a large messy library to an external hard drive?

    I have a fairly large library that is about 120 GB. My disk has absolutely no space left, and I would like to add more to iTunes. I have not been consolidating my files up to this point, which means most of my files are in various folders throughout my computer, but they are all still in itunes (I normally just drag and drop them in). I can't consolidate them now because I don't have space to copy them all again. I bought an external hard drive large enough to hold my whole library but I can't figure out how to move everything over while keeping the correct tags, ratings, etc. and even keeping all of the music that isn't in the iTunes media folder. Can somebody help me please? I don't think I will be able to add albums to the folder one by one and delete them as I go, because I have so many. Thank you!

    bump

  • Can/how do i make an iTunes library using data (songs, apps, e.t.c.) to my computer.

    Not all my music is on my old computer, and no apps are. This is as I exported the library to my D: drive, added more stuff, while syncing to it, then re-imported it. My iPod is on iOS 4 and want to upgrade to 5, but if I do, then I will lose all my apps, and most of my music. I recently got a new computer with a new iTunes library (empty). Is there any way I can 'make' a new library using my iPod touch data, so I can get iOS 5?

    - Transfer iTunes purchases to the new computer:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    - Transfer other music using a third-party program like one of those discussed here:
    Copy music
    - Connect the iPod to the new computer and make a backup by right clicking on the iPod under Devices in iTunes and select Back Up.
    - Restore the iOd from that backup. This will also update the iPod's iOS.

  • How to move my entire iphoto library and all albums and mobileme galleries to my new tower?

    What is the best way to move my entire iphoto library and all albums and mobileme galleries to my new tower?
    I want to move it smoothly without hours of reconfiguring albums and Mobileme galleries.  Already have a timemachine backup of the older iMac with the iphoto library.

    Connect the two Macs together (network, firewire target mode, etc) and drag the iPhoto library intact as a single entity from the old Mac to the pictures folder of the new Mac - launch iPhoto on the new mac and it will open the library and convert it as needed and you will be ready move forward.
    LN

  • How many movies can the itunes library hold?

    i have quit a few on there, and i want to keep them on there, aswell as add more. i'm just worried that if i go to buy a movie it'll say it can't hold anymore movies

    how many movies can the itunes library hold?
    As many as the available drives will accomodate.
    (47294)

  • How to read specific value in XML using AppleScript?

    I have a XML file which I get from Mediainfo, and I want to get the value of Format of the Audio Track from it (In this case, ALAC) using AppleScript. Could anybody help me with this? Thanks.
    <?xml version="1.0" encoding="UTF-8"?>
    <Mediainfo version="0.7.69">
    <File>
    <track type="General">
    <Complete_name>/Volumes/Macintosh HDD/Movies/Strike the Blood 12.mov</Complete_name>
    <Format>MPEG-4</Format>
    <Format_profile>QuickTime</Format_profile>
    <Codec_ID>qt  </Codec_ID>
    <File_size>1.64 GiB</File_size>
    <Duration>23mn 41s</Duration>
    <Overall_bit_rate_mode>Variable</Overall_bit_rate_mode>
    <Overall_bit_rate>9 887 Kbps</Overall_bit_rate>
    <Movie_name>[ReinForce] Strike the Blood - 12 (BDRip 1920x1080 x264 FLAC)</Movie_name>
    <Encoded_date>UTC 1904-01-01 00:00:00</Encoded_date>
    <Tagged_date>UTC 1904-01-01 00:00:00</Tagged_date>
    <Writing_application>Lavf55.33.100</Writing_application>
    </track>
    <track type="Video">
    <ID>1</ID>
    <Format>AVC</Format>
    <Format_Info>Advanced Video Codec</Format_Info>
    <Format_profile>[email protected]</Format_profile>
    <Format_settings__CABAC>Yes</Format_settings__CABAC>
    <Format_settings__ReFrames>4 frames</Format_settings__ReFrames>
    <Codec_ID>avc1</Codec_ID>
    <Codec_ID_Info>Advanced Video Coding</Codec_ID_Info>
    <Duration>23mn 41s</Duration>
    <Bit_rate>9 084 Kbps</Bit_rate>
    <Width>1 920 pixels</Width>
    <Height>1 080 pixels</Height>
    <Display_aspect_ratio>16:9</Display_aspect_ratio>
    <Frame_rate_mode>Variable</Frame_rate_mode>
    <Frame_rate>23.976 fps</Frame_rate>
    <Color_space>YUV</Color_space>
    <Chroma_subsampling>4:2:0</Chroma_subsampling>
    <Bit_depth>8 bits</Bit_depth>
    <Scan_type>Progressive</Scan_type>
    <Bits__Pixel_Frame_>0.183</Bits__Pixel_Frame_>
    <Stream_size>1.50 GiB (92%)</Stream_size>
    <Writing_library>x264 core 142</Writing_library>
    <Encoding_settings>cabac=1 / ref=4 / deblock=1:-2:-2 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=0.70:0.00 / mixed_ref=0 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=32 / lookahead_threads=5 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=9 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.70 / qpmin=10 / qpmax=20 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00</Encoding_settings>
    <Language>English</Language>
    <Encoded_date>UTC 1904-01-01 00:00:00</Encoded_date>
    <Tagged_date>UTC 1904-01-01 00:00:00</Tagged_date>
    </track>
    <track type="Audio">
    <ID>2</ID>
    <Format>ALAC</Format>
    <Codec_ID>alac</Codec_ID>
    <Codec_ID_Info>Apple Lossless Audio Codec</Codec_ID_Info>
    <Duration>23mn 41s</Duration>
    <Duration_LastFrame>-51ms</Duration_LastFrame>
    <Bit_rate_mode>Variable</Bit_rate_mode>
    <Bit_rate>799 Kbps</Bit_rate>
    <Channel_s_>2 channels</Channel_s_>
    <Channel_positions>Front: L R</Channel_positions>
    <Sampling_rate>48.0 KHz</Sampling_rate>
    <Bit_depth>16 bits</Bit_depth>
    <Stream_size>135 MiB (8%)</Stream_size>
    <Language>11</Language>
    <Encoded_date>UTC 1904-01-01 00:00:00</Encoded_date>
    <Tagged_date>UTC 1904-01-01 00:00:00</Tagged_date>
    </track>
    </File>
    </Mediainfo>

    Hello
    You may try something like the following script. It is indeed a Perl script wrapped in AppleScript, though.
    set f to (choose file with prompt "Choose the XML file")'s POSIX path
    get_audio_format(f)
    on get_audio_format(f)
            string f : POSIX path of source XML file
        do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & "
    use strict;
    use XML::LibXML;
    my $parser = XML::LibXML->new();
    my $doc = $parser->parse_file($ARGV[0]);
    print $doc->find('/Mediainfo/File/track[@type=\"Audio\"]/Format');
    EOF"
    end get_audio_format
    And a littel more general-purpose script is -
    set f to (choose file with prompt "Choose the XML file")'s POSIX path
    get_value_at_xpath(f, "/Mediainfo/File/track[@type=\"Audio\"]/Format")
    on get_value_at_xpath(f, xpath)
            string f : POSIX path of source XML file
            string xpath : XPath of target node
        do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " " & xpath's quoted form & "
    # $ARGV[0] : xml file
    # $ARGV[1] : xpath
    use strict;
    use XML::LibXML;
    my $parser = XML::LibXML->new();
    my $doc = $parser->parse_file($ARGV[0]);
    print $doc->find($ARGV[1]);
    EOF"
    end get_value_at_xpath
    Hope this may help,
    H
    PS. If copied code has extra spaces in front of every line, which appears to be the case with some browsers including Firefox, please remove them before running the script.

  • How to move pics from "picture library" to created folder

    Just started using 9310 (from 8330) with new SD card. Have a few pics on it and can't figure out how to transfer a photo in "picture library" into a newly created folder. Was so easy on 8330 with simple "move into folder" option... HELP! Thanks!

    Hello equipagekm, 
    Welcome to the forums.
    The option to move to folder will not be present but what you can do is choose the "cut" option and then once in the new folder hit the menu key and choose "paste".
    Hope this helps. Let us know if you need anything else.
    -SR
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • How to move .plist files from /Library/Preferences

    Hi,
    We are trialing using software called Deep Freeze to take a snap shot of the OS that is restored upon reboot thus removing the majority of configuration changes and thus reducing the amount of support calls.
    When setting up the software you have the option to create a "Thaw Space" that users can modify at will and the changes will persist over the reboot. Upon creating this space you are able to "map" certain directories such as Documents, Desktop and Library to the Thaw Space.
    Initially we did not move the Library folder over so that all changes to wallpapers/screensaves/dock/finder toolbar etc. were restored upon reboot, which ultimately is what we wanted to do from the beginning. This however produced a number of problems of data not being retained over the reboot when we needed it to:
    - iCal data
    - application specific settings (eg. toolbar settings in neooffice)
    - sorting email in apple mail by a field (eg. receive date)
    etc. And are continually finding new problems.
    So in the end we simply set the entire Library to be mapped to the Thaw Space, however this sets us back to square one in that the users can still change the dock, screensaver, wallpaper etc.
    It is my understanding that the files are stored in .plist files in <user>/Library/Preferences. I tried moving individual .plist files out of the Thaw Space and then creating alias files pointing to them, however these were simply deleted and replaced on reboot.
    So my question is how would I go about moving a .plist file out of /Library/Preferences
    Cheers

    It would seem to me that the problem lies with the Deep Freeze software. Changing system files in system directories is not a good idea. Why not contact Deep Freeze and have them fix their software rather than possibly mucking up your own OS.
    I would also recommend that you either update your profile or your OS. 10.5.1 had some bugs that were fixed over the years. It's always good to have the latest OS installed.

  • How to move a large iphoto library from one external drive to another

    Hi all (my first ever post to a forum!)
    I have a large iphoto library (379 GB) on an external drive (Lacie 1TB w/usb 2.0) and want to move it to a another ethernet connected external drive (LaCie Network Space 2) so I will be able to access it from other computers.
    Moving it with drag and drop or copying is calculated to take 66 day's!
    Wander if that could be explaned with the fact that these are around 70.000 individual pictures/files, and if it could be speed up by first compressing the library.
    Wander if anyone can shere their experience on that? (what software to use or?)
    I have an 21.5 inch, mid 2010 iMac (3.06 GHz Intel Core i3 with 12 GB 1067 MHz DDR3).
    I also have the new Macbook Air (1.3 GHz dual-core Intel Core i5 (Turbo Boost up to 2.6GHz - with 3MB shared L3 cache).

    iPhoto needs to be connected to the computer you are using it from via a sired connectin both for speed and also for data reliability
    THe copy estimate is often way off - let it run and see - it will probably drop a lot quickly
    Compressing would not help (assuming you shoot JPEG) since the JPEGs in the library are alread highly compressed
    LN

  • How do I rebuild a common library used by both iPhoto and Aperture?

    I'm using a common library for both iPhoto and Aperture—latest versions of each and Mavericks. I'm finding photos that are in the library that seem to have fallen out of their events or projects. When I open those events or projects, the folders are empty, however the photos are still in the database. How do I rebuild this library so as to recover my original organization?

    it will not matter, if you rebuild in iPhoto or Aperture.
    You rebuild the library by launching either Aperture or iPhoto while holding down the key combination⌥⌘  (option-command)  and double-clicking  the Aperture or iPhoto icon. Keep holding down the keys, until you are seeing the Library First Aid panel.  Select to Rebuild the database.
    Back up your library before rebuilding.
    When I open those events or projects, the folders are empty, however the photos are still in the database. How do I rebuild this library so as to recover my original organization?
    Where are you seeing the photos, that are missing from the projects, but are still in the database?
    Rebuilding will collect photos, that have lost the connection to the edited versions, and show them in a "Recovered Project".  It will not restore them to the original  projects, if it is not clear, what where the originals belong to.
    Have you checked, if you have filters set, that are hiding the photos? Check the search fields in the browser and the Info panel, if they are cleared and set to "Show All".

  • How to move albums that were saved using windows media player

    I have a number of albums that are saved on my computer using windows media player. These were saved before I got itunes. I tried moving some of the albums into itunes but they don't show in tunes. Is there a way to do this rather than read all of the cd's into itunes.
    Thank you

    Sure thing.
    In iTunes, go to File -> Add Folder to Library or Add File to Library. Select the folder which contains your music, or select individual tracks.
    If in your iTunes settings you have iTunes copy music to it's folder and manage it for you, will then make a copy of the music, and put it into the iTunes location for music. It will even convert WMA files for you, into whatever file format you have under Import Settings in your iTunes preferences.
    If in your preferences, itunes does NOT make a copy of your media, then it will simply reference the location it is in currently. If this is the case, then do not move the location of the songs from WMP. However, by default iTunes does make a copy into it's own directory, and if this is the case, you can actually delete the older files, as now you have a copy of these files in your iTunes directory.
    Does this make sense?

  • How to move object in z direction using the mouse

    I have some problems with java3d. Could you please help me with it?
    I am designing a user interface and so would like to allow the user to
    interactively move the objects in the 3d world, using the mouse. But
    presently I can allow them to move it only in the xy plane. How can I
    move them in any other plane also?
    Thank you

    Take a look at the class com.sun.j3d.utils.behaviors.mouse.MouseZoom. Also look at "Getting Started with the Java 3D API", chapter 4 on interaction, which can be found on the Java3D collateral web page.

Maybe you are looking for

  • Subcontract Reservations in RESB Table

    Hi Experts, I have reservations of child component in RESB table which are resulted from the parent component in Subcontracting Scheduling Agreement. All Delivery Schedules lines are completed (GR Made.) Still reservations exist for child component.

  • Issue in BEx Query

    I want to display the keyfigure value as: For eg: 80 has to be displayed as 80,000 Rgds, Neil

  • What is better: Export as *.MOV or Export as *.MP4 ?

    I have a couple of small DigiCam *.MP4 videos. Some of them I have to rotate 90 deg clockwise, to edit, to re-encode and to save as a new video. When coming to the "export" step I have the choice between the original *.MP4 (=MPEG-4) format and *.MOV

  • New Bank A/C Creation Error

    Hi everyone, While creating a new bank Account i am getting following error.... "Unable to verify the value entered into the OrgName field. Please select the List of Values icon for this field to select a valid value." this error actually arrises whe

  • Logon Page Customization in SAP Portal 7.31

    Hi Experts, I am planning to change the look and feel of the Logon Page for Portal. The current page is already a customized one. For making the changes, I requested and got the following files. 1. tc~sec~ume~logon~ui.war from <drive>:\\usr\\sap\\<SI