Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #16  
Old 05-23-2006, 06:03 PM
mypointofview mypointofview is offline
Registered User
 
Join Date: Sep 2005
Posts: 41
I'm ready to try the postscript technique now.

Because the following did not work: place a different picture with the same name, same access date, same modification date and same creation date into the same directory in the target volume.

SuperDuper! did overwrite it!

Actually this was a correct action, because there was a difference -- the file size. Yet all this is not so easy to understand.


Sincerely, Martin.
Reply With Quote
  #17  
Old 05-23-2006, 08:38 PM
mypointofview mypointofview is offline
Registered User
 
Join Date: Sep 2005
Posts: 41
I have now tried to run a shell script after backup to create an icon on the target drive but it did not work. Here's what I did:

1. I downloaded the shell script (can't remember - it was on this forum, perhaps this thread). It shows up on my computer as a UNIX deamon (brownish rectangle) and it's called set_icon (no suffix). I opened it with BBEdit out of curiosity and it says:

PHP Code:
#!/bin/sh
echo "Restoring icon for $3..."

if [ -e $HOME"/Volume Icons/$3.VolumeIcon.icns" ]; then
 cp $HOME
"/Volume Icons/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
 
/Developer/Tools/SetFile -a C "$4"
fi 
2. I got an icon from my Pixadex collection where I did an export as ICNS. I created a folder named Volume Icons inside my Home Library folder (to have it in a safe place). The icon I renamed as the-volume-name.VolumeIcon.icns - in my case G4 Factory.icns.

3. I launched SuperDuper! and called up my favorite Backup copy script Backup - all files (no HD icon) which is a slightly modified script that will ignore the files Icon and .VolumeIcon.icns from the top level of the master volume.

4. I went into Options > Advanced and checked the box "Run shell script...". Then I clicked the button "Choose" next to it and selected the set_icon shell script described above.

5. I did the Backup - all files (no HD icon).

6. Upon completion the new icon was not there. I looked at the volume also via Get Info in case the finder window had not been refreshing but it was just the generic drive icon.

Questions: Since I followed essentially the instructions... how do I know if I have the developpers tools installed? And: did I place the icon into the right place so that the script could actually be able to find it?

Thanks Dave for all your support. I have zero clou about Shell scripts

Sincerely, Martin.

Last edited by mypointofview; 05-23-2006 at 08:41 PM.
Reply With Quote
  #18  
Old 05-23-2006, 08:48 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Two things to check. First, log out and back in, and tell me if the icon is there.

If not, check to see if you have a "Developer" folder at the top of your drive. If not, use your Tiger disks to install them. Then, give it another try.
__________________
--Dave Nanian
Reply With Quote
  #19  
Old 05-25-2006, 09:24 PM
mypointofview mypointofview is offline
Registered User
 
Join Date: Sep 2005
Posts: 41
The icon did not show. Also I don't have the developpers folder on the top level of my drive. So it did not work because that's what was missing.

So I then went ahead and started installing XCode from the Tiger install DVD -- but hey, it wants to install 1.5 GB ...

Thanks Dave, but I guess I rather use that space for some cool movie or music (unless you have a trick for me - could I install just a component of XCode perhaps? or is it one of the other "packages"?)

... gosh, what a fuzz just to get an icon excluded from a backup!

Sometimes I therefore really think very nicely about SynchronizePro! which I used to run on OS9 ... I mean for those type of things like icon or desktoppicture.

On the other hand I really prefer SuperDuper! because of its iTunes style charm - and support
Reply With Quote
  #20  
Old 05-25-2006, 09:33 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
The specific program needed is "SetFile", but I don't know what else it depends on. But you could use Pacifist or its equivalent to extract it and put it in /Developer/Tools.
__________________
--Dave Nanian
Reply With Quote
  #21  
Old 05-31-2006, 05:13 PM
mypointofview mypointofview is offline
Registered User
 
Join Date: Sep 2005
Posts: 41
How to set icon on target disk

I got it to work

My goal was to not have a folder called "Volume icons" on the top level of my home folder. Also I did not want to have that "Developer" folder with 70MB of stuff on the root level of my drive.

Here's what I did:

1. From the Tiger install CD I installed the so-called "Developer Tools". It is not necessary to install that huge XCode package. The Developer Tools install "only" about 70 MB.

2. Once installed, I navigated to /Developer/Tools/SetFile. I put this piece called "SetFile" (looks like a dark brown Unix deamon) into my own directory (the tilde ~ stands for my user name): ~/Library/SuperDuper!/DeveloperTool/. I had to create the folder "SuperDuper!" inside my Library and in there I created the folder "DeveloperTool" (write without space!) where I then put the "SetFile" piece. Attention: "SetFile" must live in a folder without spaces in its name! In other words, from the whole Developer Tools installation you only need that one little piece called "SetFile".

3. I then created the folder ~/Library/SuperDuper!/Shell script/. Into that folder I copied the script "set_icon" which Dave posted in this thread.

4. I created the folder ~/Library/SuperDuper!/Volume icones/. Into that folder I exported from Pixadex some nice icons as ICNS. I don't know how to do it without Pixadex, but if you're into icons you probably have that app. The icon must have the name of the backup target volume in it's name. Like so: xxxxxxx.VolumeIcon.icns (xxxxxxx must be replaced with the actual name of your target volume which you choose as "to" volume in SuperDuper!)

5. Now the customization of the shell script "set_icon". I changed the file path in Dave's code in three places. One file path is now correctly pointing to the "SetFile" piece in MY folder structure. Note that I placed "$HOME" in front of the file path so that it can be found in MY Library folder. The other two file paths are also now correctly pointing to my icons. Here's the adapted code. So if you can't find Dave's script, just copy and paste the code below into a text editor and save it with the name set_icon.

PHP Code:
#!/bin/sh
echo "Restoring icon for $3..."

if [ -e $HOME"/Library/SuperDuper!/Volume Icons/$3.VolumeIcon.icns" ]; then
 cp $HOME
"/Library/SuperDuper!/Volume Icons/$3.VolumeIcon.icns" "$4/.VolumeIcon.icns"
 
$HOME/Library/SuperDuper!/DeveloperTool/SetFile -a C "$4"
fi 

6. Now setting up SuperDuper!. I clicked Options and then Advanced. I checked the last box "Run shell script..." Then click on "Choose". I navigated to ~/Library/SuperDuper!/Shell script/set_icon

I could now trash the whole Developer folder on the root of my drive - I think. Because the most important piece ("SetFile") is now in my own structure. I still have that Developer folder on my drive as I'm writing this, so I don't know if that folder is really needed or not. But before I'd trash it I'd make a copy...


That's it !

Last edited by mypointofview; 05-31-2006 at 05:15 PM.
Reply With Quote
  #22  
Old 05-31-2006, 05:33 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Glad you were able to get to a solution you're happy with!
__________________
--Dave Nanian
Reply With Quote
  #23  
Old 07-23-2006, 03:54 PM
john love john love is offline
Registered User
 
Join Date: Apr 2004
Posts: 22
Insufficient privileges to change icon???

Reference script to change icon after smart update

the first 2 lines of your script are:

#!/bin/sh
echo "Restoring icon for $3..."

SD chokes on the 1st line because of insufficient permissions ... in this case the destination is a .dmg file which is located on the 1st of 2 partitions of an external drive and obviously I am the administrator.

My second smart backup will probably have the same problem because the destination is on the 2nd of 2 partitions of the same external drive.

Thanks, Dave

John Love
Reply With Quote
  #24  
Old 07-23-2006, 03:58 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
That's because you haven't given the script execute permissions, John. So, in Terminal, you want to do:

chmod +x the-script-file

That should deal with it...
__________________
--Dave Nanian
Reply With Quote
  #25  
Old 08-02-2006, 06:13 PM
john love john love is offline
Registered User
 
Join Date: Apr 2004
Posts: 22
Changing the icon on a sparseimage

Dave:

Thanks again for the chmod +x fix ... but:

(1) for the first scenario I have in my HOME folder this file = "VolumeIcons:LaCie SandBox.VolumeIcon.icns" whose icon is my special icon and this scenario works flawlessly once I did the chmod +x in Terminal.

(2) for the last scenario I have in the same HOME folder this file = "VolumeIcons:iMac_Internal_DU.VolumeIcon.icns" ... but for this scenario I save all files to a sparseimage file = "iMac_Internal_DU.sparseimage" which when double-clicked expands to "iMac_Internal_DU".

okay, when I run SD on #2, the icon of the original volume = "iMac Internal HD" (which is the same as for #1) gets transferred to "iMac_Internal_DU", that is, no special icon?????

HAALP!!
Reply With Quote
  #26  
Old 08-02-2006, 07:18 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Not quite sure why that would be, but I don't think I considered sparse images when I wrote this. Do you really need your sparse image to have a special icon when mounted, John?
__________________
--Dave Nanian
Reply With Quote
  #27  
Old 08-03-2006, 10:21 AM
john love john love is offline
Registered User
 
Join Date: Apr 2004
Posts: 22
icon for sparseimage

No I do not need to simply because my sparseimage destination has a name (iMac_Internal_DU) that is not identical to the source (iMac Internal HD). I changed the name for the same reason that others have asked for a special icon to differentiate between the source and the destination.

The only reason for this question on sparseimages is strictly a academic curiosity.

Thanks.
Reply With Quote
  #28  
Old 08-03-2006, 10:24 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
OK. Not sure why it wouldn't work, but I don't have enough time to do a thorough investigation at this moment... if I had to guess, the volume name isn't being passed through as expected, or is different than the name of the image, or something like that.

When I get a chance, I'll try to run this down....
__________________
--Dave Nanian
Reply With Quote
  #29  
Old 08-06-2006, 02:53 PM
john love john love is offline
Registered User
 
Join Date: Apr 2004
Posts: 22
icon for sparseimage

The non-appearance of the new icon for the disk within the sparseimage is only temporary. This disk image with the wrong icon is still on the desktop ... when I eject the disk and then re-open the sparseimage, the new icon appears.

Not all wasted, however, because in the process of discovering this "feature" I developed a straight AppleScript to effect the same thing:

=====

-- "set_icon_scpt.scpt"
--
-- run after SuperDuper's 'Copy All Files to "iMac_Internal_DU"'

property theSrc : "iMac Internal HD"
property theDest : "iMac_Internal_DU"

property ICONS : "Volume Icons"
property theICON : ".VolumeIcon.icns"

copyAllFiles(theSrc, theDest)

on copyAllFiles(srcDisk, destDisk)

tell application "Finder"
activate

set destDMG to destDisk & ".sparseimage"

set iconFolder to folder ICONS in home
set newIconFile to document file (destDisk & theICON) in iconFolder

set restoreFolder to get original item of (item "Restore" in desktop)

open information window of newIconFile

tell application "System Events"
keystroke tab
keystroke "c" using command down

delay 0.2 -- a tad extra time for copying to complete
end tell

close front window -- info window of newIconFile

open document file destDMG of restoreFolder

repeat until exists disk destDisk
delay 0.2
end repeat

open information window of disk destDisk

tell application "System Events"
keystroke tab
keystroke "v" using command down

delay 0.2 -- a tad extra time for pasting to complete
end tell

close front window -- info window of destDisk

eject disk destDisk
end tell

end copyAllFiles

=====

The reason for the keystroke calls is that according to Apple's AppleScript forum http://bbs.applescript.net/, the:

get info for ...
set icon to icon of it

is broken; so the keystroke approach is necessary until Apple fixes this.

Before I go, is there a way to pass the srcDisk and destDisk parms from SuperDuper to the above AppleScript using $3 and $4, rather than my hard coding them?

***
***

Last edited by john love; 08-07-2006 at 12:19 PM. Reason: shorten script a bunch
Reply With Quote
  #30  
Old 08-13-2006, 01:48 PM
john love john love is offline
Registered User
 
Join Date: Apr 2004
Posts: 22
Pass the srcDisk and destDisk parms from SuperDuper's shell script to AppleScript

What I was trying to do initially was access within the shell script a specific handler in the AppleScript and that did not work for me.

Then I simply accessed the whole AppleScript from the shell script and within the AppleScript's on run handler accessed the specific handler ... and this worked.

After burrowing around Apple's AppleScript Bulleting Board , I found out how to pass parameters from within a shell script to an external AppleScript script ...

1) my shell script = "set_icon_shell_script.txt":

#!/bin/sh
echo "Restoring icon ..."

osascript ~/Library/Application\ Support/SuperDuper\!/Saved\ Settings/set_icon_applescript_from_shell.scpt "iMac Internal HD" "iMac_Internal_DU"

2) duped it (so I can retain the original .txt)
3) chmod +x on the copy within Terminal
4) changed the copy's suffix to .command as in "set_icon_shell_script.command"

Then I double-clicked the ".command" file, Terminal started up and it worked, as described below.

Next, is the AppleScript code:

on run parms
set theSrcDisk to item 1 of parms
set theDestDisk to item 2 of parms

copyAllFiles(theSrcDisk, theDestDisk)
end run

on copyAllFiles(srcDisk, destDisk)

-- code

end copyAllFiles

Anyway, it worked.

Just one thing is lacking ... above I have what I call the long-way-around path for the AppleScript file within my osascript call ...

This AppleScript file is in the same Folder as my shell script, yet just using:

osascript set_icon_applescript_from_shell.scpt parm1 parm2

generates "no such file" in the Terminal. ?????

Cheers!

John Love
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot find target volume Timmy General 6 03-13-2006 01:06 PM
maintaining target volume icon yoxi General 43 12-16-2005 09:41 AM
SD sannot find target Volume problem braeside General 7 09-02-2005 03:59 PM
Error while trying to enable permissions on target volume Hoosier_1701 General 11 07-16-2005 11:50 AM
Cannot find target volume -- Even with volume mounted! cmod General 3 06-03-2005 09:21 AM


All times are GMT -4. The time now is 06:13 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.