Afternoon
I have been trying to create a “batch like” file for a Mac, after doing a few searches I have discovered that this isn’t as straight forward as I had previously thought. My searchs have lead me to believe that using Applescript might be the best course of action however my knowledge of this is almost nothing and I am having some difficultly in getting started.
What my file needs to do is:
- Create a folder on the desktop with the folder structure
Desktop
-Folder 1
—Folder2 (sub folder of folder 1)
-----Folder3 (sub folder of folder 2)
-----Folder4 (sub folder of folder 2)
- Copy 3 files from the desktop that has been extracted from a .zip, to folder 4
- Go to the shared folder on the Mac and rename a file and then move it to folder 3
- Rename a file in folder 4 and the copy it to the shared folder
- Run an application.
- Preform a clean up by deleting Zip and Unzipped folders
(also the batch file I created for windows would check if installation was in programfiles or programfile(x86) which is not needed on Mac OS X i guess)
I have figured out how to create a folder on the desktop when stating the user name but the issue is the file will need to be universal to any users.
Also other than creating the Folder 1 I have just run into error.
Any advice would be great!
Cheers
(Please see below for windows version of file I created)
@echo on
CD %USERPROFILE%\desktop\
MD Folder-1
CD %USERPROFILE%\desktop\Folder-1
MD Folder-2
CD %USERPROFILE%\desktop\Folder 1\Folder-2
MD Folder-3
MD Folder-4
CD %USERPROFILE%\desktop\Folder-1\Folder-2\Folder-4\
COPY “%USERPROFILE%\Desktop\UnZippedFolder\TFF.xls”
COPY “%USERPROFILE%\Desktop\UnZippedFolder\Firm.hex”
COPY “%USERPROFILE%\Desktop\UnZippedFolder\instructions(hex).pdf”
IF EXIST "%PROGRAMFILES%\Company\Programmer" GOTO YES
GOTO NO
:yes
COPY fim.hex "%PROGRAMFILES%\Company\Programmer"
REN “%PROGRAMFILES%\Company\Programmer\old.hex” old2.hex
MOVE “%PROGRAMFILES%\Company\Programmer\old2.hex” "%USERPROFILE%\desktop\Folder-1\Folder-2\Folder-3"
REN “%PROGRAMFILES%\Company\Programmer\firm.hex” old.hex
CD “%PROGRAMFILES%\Company\Programmer*.*”
start Updater.exe
pause
CD %USERPROFILE%\desktop\
DEL “Zip”
RD /S /Q “%USERPROFILE%\desktop\Unzippedfolder”
exit
:no
COPY fim.hex "%PROGRAMFILES(x86)%\Company\Programmer"
REN “%PROGRAMFILES(x86)%\Company\Programmer\old.hex” old2.hex
MOVE “%PROGRAMFILES(x86)%\Company\Programmer\old2.hex” "%USERPROFILE%\desktop\Folder-1\Folder-2\Folder-3"
REN “%PROGRAMFILES(x86)%Company\Programmer\firm.hex” old.hex
CD “%PROGRAMFILES(x86)%\Company\Programmer*.*”
start Updater.exe
pause
CD %USERPROFILE%\desktop\
DEL “Zip”
RD /S /Q “%USERPROFILE%\desktop\Unzippedfolder”
exit