Can AS know if an desktop icon already exists in a location

this code moves a file on the desktop to a specific location.
tell application "Finder"
set desktop position of alias "Macintosh HD:Users:Shawn:Desktop:The Matrix Effect - Video.webloc" to {1800, 1000}
end tell
Can you ask Applescript if an icon is already there, if so then just add 100 pixels in the code so the new icon is offset a bit. Thanks

For most (but not all) properties, if you can set them then you can also get them (check the application dictionary to verify the properties you're after).
Therefore, in this case, all you need to do is first get the desktop position, then you can make whatever adjustments you like:
tell application "Finder"
  set thePos to desktop position of alias "Macintosh HD:Users:Shawn:Desktop:The Matrix Effect - Video.webloc"
  -- now you have the icon position so move it
  set desktop position of alias "Macintosh HD:Users:Shawn:Desktop:The Matrix Effect - Video.webloc" to {(item 1 of thePos) + 100, (item 2 of thePos) + 100}
end tell
If you want some kind of collision detection (to see if there's an icon in that place already) you'll need to get the desktop position of each item on the desktop and iterate through them. It'll be relatively easy to account for icon size (just add an offset to your checks), but handling the text label will be harder (there's no way I'm aware of to find the position of the file name).
(you don't say which way you want to move it, just amend the offsets as appropriate)

Similar Messages

  • HT3964 How can I get back the desktop icons?

    I am forced to start up my iMac 10.6.8 using PRAM. However when it starts up there are no desktop icons showing, only the dock shows which gives me limited internet access. Can anyone help me recover desktop icons?

    Reinstall OS X without erasing the drive
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.

  • I have been backing up my photos to an external hard drive. I usually choose the photos, copy and paste them to the EHD. It has started saying "an item named "unnamed.jpg" already exists in this location. I don't know what to do.

    I have the MacBook OS X 10.5.8, 2.4 GHz, 2 GB. I have been backing up my photos to an external hard drive since I purchased it. I usually choose the photos, copy and paste them to the EHD. It has started saying "an item named "unnamed.jpg" already exists in this location. Do you want to replace it with the one you're moving? Don't replace/Stop/Replace". I don't know what to do.

    Thanks Jim, I kind of thought that was the answer, but was hoping against hope that I was just missing something. Like I said, it's not a big problem. One work around I've found is to name a folder on the external hard drive the same as the name I give the folder to import to and then choose this folder to back up to. I still get a subfolder inside that folder named Imported on...... but at least it's in the folder with my chosen name.
    Thanks again,
    Jack

  • How can we transfer product attributes from an already existing site?  We have thousands of items and it would be tedious to do them one at a time.  Is this possible through a CSV?

    How can we transfer product attributes from an already existing site?  We have thousands of items and it would be tedious to do them one at a time.  Is this possible through a CSV?

    There are two parts to this:
    1) It may be that you should have an Apple Education Support person helping you with this. If you have enough computers for this to be a problem, you may benefit from a Server, a site license, and an occasional visit from an Education Support Specialist.
    2) The brief answer, if you want Individual Apple_IDs to control each computer, is to buy new copies of Mac OS X under those new Apple_IDs and re-download and re-Install. Mac OS X is customized to the Apple_ID before it is downloaded.

  • Tried to download 16.0.1 but got following message: A newer version named Firfox.app (15.0) already exists in this location. Do you want to replace it with the

    I have a MacBook 10.5.8 OS. I have been getting an auto update notice for updating my current version 15.0 to 16.0.1. Tried to download version16.0.1 from Firefox web but got following message: A newer version named Firfox.app (15.0) already exists in this location. Do you want to replace it with the one you are moving? How can this be if the current version on my mac is 15.0?

    Have you tried just using the built in updater to update firefox? [[Update Firefox to the latest version]]

  • How to know if a particular CWPlot already exists in a CWGraph (VC++)?

    I would like to add a CWPlot to a CWGraph only if this plot doesn't already
    exist within the CWPlots collection.
    The problem is that when I call "myGraph.GetPlots().item((COleVariant)
    "PlotN")", an exception is throwned if the CWPlot named "PlotN" doesn't
    exist.
    I do have a workaround : testing all the names of CWPlots collection untill
    I find (or not) the right name, but as I have a lot of plots in my graph, it
    is very time expensive.
    Is there a more elegant way of knowing a plot presence in a graph ?

    Georges:
    Exceptions are the way that C++ handles all errors, and it's okay to catch exceptions yourself and process them however you like. In this case, for example, I would recommend trying the Item() call and catching the resulting exception. Examine the exception, and if it is one complaining about an "Invalid Index", then you can add the plot and suppress the exception from propagating up the call stack. Here's an example of what I mean:
    //================================================​==============================
    // Return the requested plot. If it's not there, then add it and return it.
    //================================================​==============================
    CCWPlot CGeorgesDlg:martGetPlot(CCWGraph &graph, LPCTSTR name)
    CCWPlot plot;
    try {
    plot = graph.GetPlots().Item(COleVariant(name));
    catch(COleDispatchException *e) {
    // If it's not the exception we're looking for, let it go up the call
    // stack, otherwise ignore it.
    if(e->m_scError != 0x800A0005) /* invalid index */
    throw e;
    e->Delete();
    // If an exception occured, then add the plot.
    if(plot.m_lpDispatch == NULL)
    plot = graph.GetPlots().Add();
    plot.SetName(name);
    return plot;
    You could use this helper method to access plots. For example:
    void CGeorgeDlg:nModifyPlot()
    SmartGetPlot(m_graph,"Plot X").SetEnabled
    (TRUE);
    // or
    CCWPlot MyPlot = SmartGetPlot(m_graph,"Plot Y");
    // work with MyPlot variable....
    I hope this helps,
    Chris W.
    National Instruments

  • Can`t rename computer computer account is already exists

    We have domain on 2 DC`s(1 is GC and the 2nd is DC(Server 2008r2 ent)), Sometimes we need to replace old computers to the new ones. But they have to to be named like the old ones. So sometimes after removing old comuter from the AD, we still have an error
    message "Can`t rename, computer account is already exists" where else should we remove it????????

    Let's try the following:
    - configure the other domain controller as a Global Catalog - this should be the case in a single-domain forest
    - force the garbage collection by following http://blogs.technet.com/b/ad/archive/2009/03/24/taking-out-the-trash.aspx
    Check the list of deleted objects again afterwards.
    If this does not provide the resolution, restore the tombstone of one of the deleted computers (followhttp://technet.microsoft.com/en-us/magazine/2007.09.tombstones.aspx ),
    rename it , and delete it
    hth
    Marcin
    i`ve tried all of that except, configuring other Dc as GC, i ve found an article http://technet.microsoft.com/en-us/library/cc737269(v=ws.10).aspx it
    says that nothing would happen if two DC`s will be GC`s, but it vad not been written that this article aplies to win2008r2 only to earliests OS`s, so i`m affraid if something wrong will happen if i will promote another DC to GC, or i`m wrong??!
    I couldn`t force garbage collection, but i`ve enabled log as you said, and it seems to be no trouble with it....
    about the restoring tombstone.... i ve stuck on the step when i should search the deleted object, because search result "getting 0 entries"
    The same thing is about the article that Sandesh Dubey had linked "http://technet.microsoft.com/en-us/library/dd379509(v=ws.10).aspx"
    if i am not wrong, i should go to Configuration in tree of ldp and then to the Deleted Objects, but it says that there is no children.
    Please people be patience with me, i really am need your help!

  • How can I get rid of desktop icon without deleting the actual item?

    Installed Seagate as time capsule. Icon on desktop. How can I get rid of icon from desktop without deleting the Seagate?

    In Finder -> Preferences you can tell it not to display mounted devices.

  • When upgrading Firefox I get the message, "An older item named "Firefox" already exists in this location. Do you want to replace it with the newer one you're moving?". Choosing YES results in "Operation can't be completed because item "Firefox" in use."

    Using Mac Snow Leopard 10.6.7
    Current Firefox: 3.6.18
    Trying to update latest version: 5.0.1
    This seems quirky. In Updating a newer version of Firefox is should seem obvious that the existing firfox executable would be replaced by the newer version ?!?
    Thanks for any help you can give.

    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Can't sync Movie Rental to Iphone already exists on another device?

    I have rented two movies and have not touched them.  I tried moving one over today to syn with my iphone so we could watch and I received the followin "Rentals in your itunes library could not be transferred to the iphone "_____'s phone" because it has already been trasnferred to another computer or device"  I have not connected to any other computer or device so I am a little confused any suggestions would be helpful.

    sorry, but has anyone any thoughts on this?

  • Can't create eprint service account, says already exists, won't send password to my email ????

    When I try to create an ePrint service account it tells me there is already an account with my email address. I do have an account on the hp website but it does not accept that password. When I request that is send the password it asks for my email and when I type it in and submit it comes back with the error message to give the email address associated with the account.
    This is crazy and frustrating. If the email address has an account associated with it then why won't it send password info to that email address.
    Any suggestions would be welcome.

    Hi,
    More likely your ePC account was assigned to the SnapFish service during its first registration and therefore the described behavior appears.
    Please try the following steps and check if that may help:
    1. Go to http://www.snapfish.com and click the Log In option at the top.
    2. Click 'Forgot your password?' and follow the directions.
    3. Make sure to log in to Snapfish using the temporary password and complete the proccess to select a new password.
    4. Go to http://www.eprint.com and login using the modified account details
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Can I sync my iCal with my already existing Gmail Calendar?

    I am trying to simplify life and that includes synching my calendars all into one. I mainly use my Google Calendar and would like to be able to sync it to my iCal. I tried copying the URL, but it said it would not work....any suggestions on what I may be doing wrong?

    Greetings,
    Suggestions:
    If you both put your calendars into a calendar sharing service like iCloud, Google, or Yahoo that would allow you to share calendars / events directly. 
    Add each other as invitees to your shared events: http://docs.info.apple.com/article.html?path=iCal/2.0/en/wr36.html
    Use a different calendar program that will share across your local network: http://busysync.com
    Hope that information helps!

  • Images imported from a digital camera were viewable and editable at first but later disappeared! They cannot be re-imported from either the camera or the iCloud as iPhoto indicates that they already exist, but cannot locate them. Please help!

    On holiday I have been uploading my photos to iphoto on my macbook pro every few days, the latest batch appeared and I was able to edit them, flag, merge events etc. However, later that day when I went back to the images they could not be found in my library. They had been removed from 'latest import', however were viewable on the icloud photo stream. I have attempted to re-import the images from both the digital camera and my photostream but iphoto indicates that the images had already been imported and would not import them again. I was able to locate the master images using finder, but Iphoto tells me that these files are unreadable (they are .jpg) when I try to re-add them this way. I have also tried to 'unhide' all images in case I had accidentally hidden them but this didn't work either.
    Any other suggestions?

    a best practice to is to never have any computer program (including iPhoto) delete the photos from the card but to import the photos and keep them and then after at least one successful backup cycle has completed and then reformat the card --  I use three very large (32 GB) cards in rotation so I do not reformat for typically a year or more giving me one more long term backup of my photos
    Back up your iPhoto library, Depress and hold the option (alt) and command keys and launch iPhoto - rebuild your iPhoto library database
    LN

  • Help.  I can't move my desktop icons

    Why can't I move my desktop icons around? 

    Take these steps if the cursor changes from an arrow to a white "prohibited" symbol when you try to move an icon on the Desktop.
    Sometimes the problem may be solved just by logging out or rebooting. Try that first, if you haven't already done it. Otherwise, continue.
    Select the icon of your home folder (a house) in the sidebar of a Finder window and open it. The Desktop folder is one of the subfolders. Select it and open the Info window. In the General section of the window, the Kind will be either Folder  or something else, such as Anything.
    If the Kind is Folder, uncheck the box marked Locked. Close the Info window and test.
    If the Kind is not Folder, make sure the Locked box is not checked and that you have Read & Write privileges in the  Sharing & Permissions section. Then close the Info window and do as follows.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    xattr -d com.apple.FinderInfo Desktop
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal 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. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You should get a new line ending in a dollar sign ($). Quit Terminal.
    Relaunch the Finder.
    If the problem is now resolved, and if you use iPhoto, continue.
    Quit iPhoto if it's running. Launch it while holding down the option key. It will prompt you to select a library. Choose the one you want to use (not the Desktop folder.)

  • BB Desktop icon on PC

    With my BB8520 I received a disc which I could download onto my PC. Now bought a BB9320. Downloaded BB 7.0 version onto PC but cannot access it or put it this way I am not that computer literate. Deleted the original Desktop 5.0 version. How can I put a BB desktop icon on my PC screen as I have to search for the file each time & I don't know how to make my backups on the 7.0 version.

    Firstly, with my BB8520 I received a Blackberry User Tool CD for the Blackberry Desktop Manager & V5.0.1 was applicable at that stage.
    I now have a BB9320 Curve but this phone never came with the BB User Tool CD. I've subsequently downloaded the latest Blackberry Desktop Manager (710_b042 multilanguage). Now this is where I get stuck - everything is zipped. 
    Now my first question - How do I make my backups using the latest version?
    Question two:- With the CD loaded onto my desktop pc I HAD a Blackberry Desktop Manager icon on my screen. How do I create an icon again on my desktop pc with the latest version. 

Maybe you are looking for