I have written quite a few applescripts that I use on a daily basis on my Power Mac G5. I have newly acquired a laptop that I’m looking to run my applescripts on. The problem is that the path name’s (I think that is the right term) are not named the same:
Old Computer:My Hard Drive:Users:Me:Documents:My Scripts:Script A
New Computer:Macintosh HD:Users:New User:Documents:My Scripts:Script A
I have done some searching and found some “search and replace” scripts that allow you to manipulate text documents. But what I’m looking to do seems a bit more complex. At first I was going to create a search and replace applescript that was going to search through my applescripts and replace the text for the old path name with the new one I assigned for my new laptop. I thought that would solve the problem immediately. But then I thought, I would just have to do it again if something got renamed. I thought of the following way that I think would be a much better approach if it’s even possible. I’m new to writing code all together, so this is a little out of my league.
-
Have finder (maybe?) find the path name for the “My Scripts” folder on the new laptop.
-
Get all the files in the “My Scripts” folder
-
Search and replace all text “My Hard Drive:Users:Me:Documents:My Scripts” with new path name.
I thought this way, even if I renamed something (Hard Drive name, Documents Folder Name, Etc), I could just run the script again and I wouldn’t have to keep typing in the name of the new path before running the script. It would also work if the same thing happened on my desktop as well.
Is this even possible? I read some article reguarding making the path name a variable and a couple other options. But to be honest, it’s a lot of new ideas and lingo to wrap my head around for as new as I am to the game. Any idea’s on how to write this?
Thanks again in Advance. Eveyone on this sight is always most helpful.