Results 1 to 2 of 2
Discuss Cant Get My App To Work - AppleScript at the Genuine Mac Support - Hackint0sh.org; Hey Guys, Im working on a script that renames a file, then copies it to ...
  1. #1
    Senior Professional Array JayBird's Avatar

    Join Date
    Oct 2008
    Posts
    373
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    27

    Unhappy Cant Get My App To Work - AppleScript

    Hey Guys,

    Im working on a script that renames a file, then copies it to a directory, However i get perm denied - I have added code below. Any help would be really appreciated. Cheers

    // Renames File

    tell application "Finder"
    set theFile to (desktop as text) & "New.jpg" as alias
    set name of theFile to "DefaultDesktop.jpg"
    end tell

    // Tries to copy to destination

    do shell script "cp -r /$HOME/Desktop/DefaultDesktop.jpg /System/Library/CoreServices/"


    This is what i get in Results Section

    error "cp: /System/Library/CoreServices/DefaultDesktop.jpg: Permission denied" number 1
    I Do Not Condone Piracy, If You Like It BUY IT! - It's Ok To Test But Not Steal - MacBook Pro Owner

    iPhone Owner 3G



  2. #2
    Senior Professional Array JayBird's Avatar

    Join Date
    Oct 2008
    Posts
    373
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    27

    Smile

    Just an Update - Fixed


    // Tries to copy to destination

    do shell script "cp -r /$HOME/Desktop/DefaultDesktop.jpg /System/Library/CoreServices/" with administrator privileges

    // with administrator privileges - What this does is prompt the user to add their u/name & Password

    Resolved
    I Do Not Condone Piracy, If You Like It BUY IT! - It's Ok To Test But Not Steal - MacBook Pro Owner

    iPhone Owner 3G

 

 

Similar Threads

  1. Command Line Service using Applescript
    By sailor0703 in forum Genuine Mac Support
    Replies: 7
    Last Post: 12-28-2010, 09:18 AM
  2. MacNN: Changes 1.5 adds AppleScript, performance gains, more
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 03-31-2009, 09:30 PM
  3. MacNN: DMG Architect v1.5 adds AppleScript support, more
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 09-09-2008, 12:50 AM
  4. Slashdot: Mac OS X Root Escalation Through AppleScript
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 06-18-2008, 11:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 10:27 PM.
twitter, follow us!