Script Works on MacBook and Mac Mini but Not MacBook Air

I just bought a new Mac Mini and 11' MacBook Air, and I have a script that works on the former but not the later. Running it on my Air generates the error, "error "Finder got an error: Can’t set alias "My Hard Drive!:directory path:File Name copy.doc" to "FileName}doc"." number -10006 from alias "My Hard Drive!:directory path:File Name copy.doc".
Here is the script:
tell application "Finder"
set theFile to item 1 of (get selection)
set TheName to name of theFile
set duplicatedFile to (duplicate theFile) as alias
end tell
set capName to do shell script "/bin/echo " & quoted form of TheName & " | /usr/bin/awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1' | tr -cd [:alnum:]_. "
tell application "Finder" to set name of duplicatedFile to capName
set longURL to "http://domainname.com/" & capName
set curlCMD to "curl --stderr /dev/null "http://bit.ly/api?url=" & longURL & """
set bitLy to (do shell script curlCMD)
set the clipboard to bitLy
set curlFTP to "curl -T " & quoted form of POSIX path of duplicatedFile & space & quoted form of ("ftp://unsername:[email protected]/path/" & capName)
do shell script curlFTP
tell application "Finder" to move (duplicatedFile as alias) to trash

There is a problem with duplicate names.
!http://farm2.static.flickr.com/1283/5188829536_841015b22c.jpg!
I am not sure what statement failed for you. Please clarify if I guessed wrong.
I did encounter some problem with the exclamition point in a name.
There could be a problem with exclamation point in a url, but didn't try.
You could use unix to do the rename.
tell application "Finder"
   set theFile to item 1 of (get selection)
   set TheName to name of theFile
   set duplicatedFile to (duplicate theFile) as alias
end tell
log duplicatedFile
set capName to do shell script "/bin/echo " & quoted form of TheName & " | /usr/bin/awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1' | tr -cd [:alnum:]_. "
-- Use unix to rename
set unixName to POSIX path of duplicatedFile
log "unixName=" & unixName
set baseP to do shell script "dirname " & quoted form of unixName
log "baseP=" & baseP
set baseN to do shell script "basename " & quoted form of unixName
set baseN to quoted form of baseN
set baseP to quoted form of baseP
-- Rename the file. 
set what to do shell script "cd " & baseP & "; " & "mv " & baseN & " " & capName
-- tell application "Finder" to set name of unixName to capName
log "what=" & what
set longURL to "http://domainname.com/" & capName
log "longURL=" & longURL
set curlCMD to "curl --stderr /dev/null \"http://bit.ly/api?url=" & longURL & "\""
log "curlCMD=" & curlCMD
set bitLy to (do shell script curlCMD)
set the clipboard to bitLy
set curlFTP to "curl -T " & quoted form of POSIX path of duplicatedFile & space & quoted form of ("ftp://unsername:[email protected]/path/" & capName)
do shell script curlFTP
tell application "Finder" to move (duplicatedFile as alias) to trash
Robert

Similar Messages

  • Why is my Internet connection hanging on both MacBook and Mac mini, but not PCs, Xbox, or iOS devices?

    I have a MacBook pro and Mac mini both running the latest version of lion.  I've had this issue with my MacBook for sometime now, but just dealt with it and figured it was isolated, but now I am finding its not.
    Essentially, I will open up safari, or Chrome, and the first few pages will load fine.  Sometimes I will get lucky and be able to browse normally, but after awhile, safari just hangs there and stops loading.  I can close the window, and open a few more pages before it does it again.  Both my mini and MacBook do this, but only on my home network.  My MacBook runs perfectly fine on my work wi if, and other wi fis, so I definitely know its my home modem.  If I wait it out I can surf the Internet again, but this dead time is absolutely killing me. It just randomly stalls, on both computers.
    I current have time Warner cable roadrunner, with a cable modem gateway.  The issue was happening on a straight connection.  I had hoped getting a time capsule and connecting to that network would solve things, but it didn't.  Interestingly enough, my Pcs, Xbox,and all 4 of my iPads and iPhones work just fine on the wifi, so there has to be a communication issues with the MacBook and mini with the cable router.
    I've tried messing with lions network DNS servers and tried opendns ones, but those didn't work.  Sometimes I can fix the problem for a few hours by power cycling the modem and router, but I shouldn't  have to do that over and over every time it's an issue.  I've also tried removing and adding the wi if connections, but that.works for a minute or two and then the problem resumes.
    Now, I have my time capsule connected to the gateway, and tuned the time Warner modem wireless off, which didn't help of course, but at least I'm properly backed up.
    I'm not sure what the issue is.  I've even tried typing an ip address of apple during a dead time to see if that worked and didn't.
    Does anyone have any other ideas?  I'm pretty much at my wits end in this, any ideas would be greatly appreciated

    Have you tried a simple reset of your iPod to see if that helps?  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear.
    Otherwise, have you tried any of the troubleshooting mentioned in this Apple support document?
    iOS: Troubleshooting Wi-Fi networks and connections
    B-rock

  • I can not get Firefox to play music backgrounds on pages in browsers it works in IE and other browsers but not firefox, what HTML or Jave script do I need too use to make them work?

    I'm having a problem with firefox playing background music on some sites, it works with IE and other browsers but not with fire fox, what html or java script do I need to add to the pages so that they play the music?
    I develop my pages in Front Page and I know that the music only works in IE, so if someone can tell me how to correct this problem as it is important as I use fire fox as my main browser.
    I thank you in advance

    If a website uses BGSOUND then it will only work in IE.
    BGSOUND is not compatible with other browsers like Firefox.
    * http://kb.mozillazine.org/Background_music_does_not_play

  • A DVD (mpg file only) comes up on my MacBook and Dell PC but not my iMac.  Aren't all Macs alike?

    A DVD (mpg file only) comes up on my MacBook and Dell PC but not my iMac.  Aren't all Macs alike?  I was told by a couple of experts to copy the file on my MacBook and then send it to my iMac.  But shouldn't my iMac show it now if my little Mac does?

    Zap the PRAM and Reset the SMC, then pop in the DVD again.

  • Use one iTunes Library for both my MacBook and Mac Mini

    Hi,
    I want to make a few changes in my configuration, but before something will go terribly wrong, I want to make sure I use the correct approach.
    Yesterday I got a and on an older Mac Mini Model (G4 - only 40GB hard disc). It runs Leopard. It does not have Wifi, but it is connected to my modem/router.
    I also have a MacBook. Currently I have my iTunes Library on an external HD (WD mypassport 320GB) that I hook up to my MacBook when playing music and syncing my iPhone and iPod.
    However; I want to use the Mac Mini as a 'Mediacenter' (Big term, because it cannot play HD movies (processor is too old; I mean I want to use it for iTunes and as a DVD player). I have another external HD (Lacie - 500 GB; bigger than the one first mentioned, but this one is not a mobile device). I want to hook this HD to the Mac Mini and put my iTunes Library on this HD so it can be approached through the Mac Mini. Subsequently I want to approach the same library on my Mac Mini on my Macbook…This to control and manage the iTunes library and to keep syncing my iPhone through my Macbook (this is easier to do, because the Macbook has a Keyboard….)
    Few questions;
    1: is this even possible?
    2: to transfer my library I will use this method http://support.apple.com/kb/HT1751?viewlocale=en_US
    First copy the library from the WD HD to the Lacie HD; then choose the library on the Lacie in iTunes on the Mac Mini
    Then I will have my iTunes Library copied to the Lacie and connected to my Mac Mini.
    Then for the second and 'harder part'. The Sharing of one Library over two Macs.
    I think I can use the homesharing option. The above mentioned method transferred the whole current library and I can choose the option to automatically transfer new content from my MacBook to the Mini (correct?). But this leaves me with two libraries with the same content (one on the Mini (Lacie) and one on the Macbook (WD).
    Is it possible to use only one library (the one on the Mini) and approach and manage it on my Macbook and also syncing my iPhone through my Macbook? I understand that it will loose some speed as the data will be transferred through Wifi from the Mac Mini to the MacBook. But as I will not listen to the music on my MacBook, but only will use it to manage the library, I can handle this….

    I managed to transfer all music, movies and tv shows to the External HD (Lacie) and connected that one to the Mini. Then imported all files to the library on the mini. Quite easy!
    The second part I left out. It seems the home sharing option works fine for now. I can still 'manage'the library on the mini from my Macbook with the 'share screen' option.

  • Using a 1TB G-Drive with macbook and mac mini

    After checking the net for solutions, I have decided to post here. Hopefully I haven't missed something as to not be redundant.
    Currently I am using time machine to do incremental backups on my unibody macbook to my g-drive wirelessly through my airport extreme via usb.
    I ordered a unibody mac mini and I was wondering if I could connect the mac mini to the g-drive via firewire 800 and back up both mac mini and macbook to the one drive.
    I know time machine can handle the multiple computer situation, but I don't know if it can handle the 2 inputs simultaneously. USB from the airport extreme and firewire 800 directly from the mac mini.
    Thanks for the help,
    Reardan

    Well after experimenting, I found that the mac mini would not recognize the g-drive while it had both USB and firewire plugged in.
    So what I did was unplug the usb and shared the g-drive through the mac mini with file sharing.
    The issue is now that my macbook does not seem to be able to deal with the new path.
    I can view the contents of the g-drive but the .sparsebundle file can not be opened on my macbook. It tries to mount it as a disk image.
    Anyways, any insight would be appreciated.
    Thanks

  • Auto Sync iTunes Libraries between Macbook and Mac Mini?

    I download and store all of my music on my Mac book. But I would like to know if it is possible to make it so that, if I add 3 songs to my macbook, my Mac Mini will reflect the same changes, and vice versa. Kind of like what Mobile Me does with iCal and Contacts.
    So If I add a song on my Macbook, my home network would transfer the song to my Mac Mini and update the iTunes library?
    And I'd rather not use an external network drive to keep my library on, because I need my music physically on my Macbook.
    Is this possible?
    Thanks in advance.

    There are a few utilities specifically designed to help you sync iTunes across different computers. You could begin your research by having a look at these for instance:
    TuneRanger
    SuperSync
    syncOtunes

  • Flash works in mini but not macbook?

    ok, so macs are not in "good terms" with flash based programs... my problem ...
    i have a ppc mac mini, tried it with flash based websites and fan started to spin. so to avoid such problem i avoided the website.
    now playing a flash based game using flash projector for mac ppc version works fine for my mac mini. however when i tried the latest flash projector universal it does not work fine, fan started to spin at high speed so had to go back to flash projector ver 8 and everything works ok
    the problem... using my macbook where can i get a decent flash projector? because all the projector i used to play the game makes the fan runs high once in a while... (from old ppc flash based projectors up to flash projector v.9)

    Flash sites use a lot of CPU, which gets the fans going. It's normal.

  • I've updated one of my contacts and the entry is corrected on my iMac and my iPhone, but not MacBook.  Why not?

    I've updated one of my contacts (to correct their email address) and the correction was made on my iMac (where I made the correction) and my iPhone, but not on my MacBook.  All three devices are on the "cloud"...

    but not on my MacBook.  All three devices are on the "cloud"...
    On the Macbook switch Contacts off then back on in System Preferences > iCloud then restart the Mac.

  • My flash drive works on a Mac mini, but not on a MacBook Pro. How do I get it to work?

    Also, when I plug my phone into the computer using the USB drive, the computer does not recognize it. I have not tried my phone on the Mac Mini. They have both worked before on my MBP. What's the problem?

    It may just not be configured to SHOW.
    1. Finder>Preferences.
    2. MISSING FROM DESKTOP: Make sure under "General" for "Show these devices on the desktop" that you have a CHECK mark under "hard disks" as well as "external disks" (if you have a dash that indicates specific items are set to hide and others are not)
    3. MISSING FROM SIDEBAR: Check the same items under the "Sidebar" section if you are missing them from the Sidebar of Finder.
    EE

  • MacBook and Mac mini togheter?

    Hi everyone... I'm the proud owner of a MacBook but I'm studying Computer Engeneering and my MacBook is becoming slower and slower.. So my question is if I'm able to use Mac mini conected to my MacBook using it as a screen.
    Thanks for your answer!!

    Welcome to the Apple Discussions!
    It is not an ideal situation. The best thing is to buy an inexpensive screen, but this app may work for you for a while.
    http://www.screenrecycler.com/ScreenRecycler.html
    Dah•veed

  • 10.6.5 allows rename of Public folder on Mac Mini but not on MacBook Pro

    I have 10.6.5 running on a brand new Mac Mini and it lets me rename my Public folder so I can recognize it easily on my home network. My one year old MacBook Pro has this renaming option grayed out and I can't find how to enable it. I've looked at the sharing preferences and other places and I've searched this support forum.
    Any ideas of what I might be forgetting to check, or set, or disable, or something?

    Thanks for the tip. I marked my question solved, but I'm not really sure why one computer lets me rename and the other doesn't. I'll bet you're right and I shouldn't be renaming that stuff. I used Time Machine to go back to before I did that.
    I'm now connecting to both machines as a registered user and I can ignore the Public folders anyway.
    One thing still puzzles: the MacBook connects to the Mini almost instantly, but the Mini takes maybe a minute or more to connect to the MacBook. I thought about it waking the disk from sleep, but I've tried this right after making the MacBook do something to make sure it's spinning the disk. Maybe I'll play with it some more and search for answers or post another question later.

  • External usb microphone not working with FaceTime and mac mini with os x Yosemite

    Hello
    When I try to do a phone call with face time through my iphone 6 face time is not recognizing my external usb microphone connected to my mac mini. I have just updated my mac mini to os x Yosemite. If I go to the audio system preferences and look to the audio input signal I can see that the external microphone (SB Omni Surround 5.1) is working (audio input level is showing an input signal).
    Can someone help. I saw that this was also an issue in the beta versions of Yosemite.
    Thanks.
    BR Stefan

    Interesting.  I don't have a USB mic on the Mac Pro.  Its the OLD FireWire 300 iSight.  It works for FaceTime calls but not the iPhone call via the FaceTime app.
    I also have 2010 MBP that works perfectly, even since the first Public Beta.  I'm to sure if that mic is considered an external USB device or not, or if it has to do with device signatures vs. external or internal.  I would almost assume that the built-in mic is on the USB bus.  How would it be any different than the external USB.
    I think I have to agree that this is a point release bug.  I have submitted a bug report at bugreport.apple.com, and would ask others to do the same, or at least post to apple.com/feedback.  The more noise we make through process the more likely to get a fix in the .1 release.

  • Best program to clean Macbook and Mac mini?

    What is the best program to clean up a Macbook Pro, and a Mac Mini?

    When you see a beachball cursor or the slowness is especially bad, note the exact time: hour, minute, second.  
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
    Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
    Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Windows 7 and Mac Mini Server not connecting

    I'm running a small design studio in Central Asia. For four years we've had a Mac Mini Server (Snow Leopard/Lion), working with three Macs, and two PCs (Windows XP) connecting, sharing files and accessing accounting software without any issues.
    Due to Windows XP being discontinued we upgraded the PCs to Windows 7 Ultimate (it was the best that was available legally locally). The Windows machines both continued to connect to the server, although getting it to work initially was harder than with XP.
    Our Mac Mini Server showed signs of dying, so this week we purchased a new Mac Mini Server with Mavericks (10.9.3). The macs in the office can see it fine, however the Windows 7 machines are unable to see the server on the network or access using the smb path. They can access the old server using smb, however in the network control panel, the old server is also invisible.
    The server has SMB/AFP enabled. The Windows 7 machines are set to recognise networks and supposedly therefore to see others. They are failing to do either. It seems like both MS and Apple changed the way they communicate pretty significantly.
    How can I get the Windows 7 machine talking with the new Mac Mini Server?
    Thanks for any advice.
    Richard

    The problem of the machines connecting seems to have solved itself today - with one small tweak to the setup.
    I inserted an underscore (_) instead of spaces into the Mac Server name, and although the Windows 7 machines still can't see the server they can now connect using SMB.
    I can't believe something so small kept me so flummoxed for so long....

Maybe you are looking for