Jump to content

alfredappuser

Member
  • Posts

    32
  • Joined

  • Last visited

Posts posted by alfredappuser

  1. Finally creation of multiple iso files works:

    OIFS=$IFS
    IFS="	"
    
    foldersArray=({query})
    
    for ((i=0; i<${#foldersArray[@]}; ++i))
    do
    	ir=$(expr $i + 1)
    	folder=$(basename ${foldersArray[$i]})
    	folderMin=${folder//[[:blank:]]/}
    	parentFolder=$(dirname ${foldersArray[$i]})
    	folderFinal=$parentFolder/$folderMin.iso
    
    	hdiutil makehybrid -hfs -iso -joliet -o $folderFinal ${foldersArray[$i]} > /dev/null
    
    	if [ -f $folderFinal ]
    	then
    		echo "$ir: $folderMin.iso created"
    	else
    		echo "$ir: Creation of $folderMin.iso went wrong!"
    	fi
    done
    
    IFS=$OIFS
    
  2. EDIT: The problem were the double quotes.

     

    Now following works with a single folder:

    FOLDER=$(basename {query})
    FOLDERMIN=${FOLDER//[[:blank:]]/}
    FINALFOLDER=~/Desktop/$FOLDERMIN.iso
    
    
    hdiutil makehybrid -iso -joliet -o $FINALFOLDER {query}
    
    if [ -f $FINALFOLDER ]
    then
        echo "ISO file $FOLDER.iso is available on your desktop"
    else
    	echo "File is not created! Anything went wrong."
    fi
    

    My next step is to extend code, that it also can handle multiple folders (each folder to iso file)

  3. Thank u for your reply :-)

     

    • I have enabled all escaping options except "Backslashes"
    • The following script now works.
      • But if you look at the code, I've tried to create the complete output path in variables. But this does not work. For now it is ok, but I want to  extend the workflow and for this it would be nice if this also works.

    Do you have an idea?

    FOLDER=$(basename {query})
    FOLDERMIN=${FOLDER//[[:blank:]]/}
    
    FINALFOLDER="~/Desktop/$FOLDER.iso"
    FINALFOLDERMIN="${FINALFOLDER//[[:blank:]]/}"
    echo $FINALFOLDERMIN
    
    
    #hdiutil makehybrid -iso -joliet -o $FINALFOLDERMIN {query}
    hdiutil makehybrid -iso -joliet -o ~/Desktop/$FOLDERMIN.iso {query}
    
    if [ -f ~/Desktop/$FOLDERMIN.iso ]
    then
        echo "ISO file '$FOLDER'.iso is available on your desktop"
    else
    	echo "File is not created! Anything went wrong."
    fi
    
  4. Thx for your reply. If I run the following script within bash it works / on File Action it don't works:

    QUERY="{query}"
    
    if [ -d "$QUERY" ]; then
    	PARENTDIR=`dirname $QUERY`
    	DIR=`basename $QUERY`
    	FILEEXTENSION=".iso"
    	cd $PARENTDIR
    	mkisofs -o $DIR$FILEEXTENSION $DIR
    fi
    

    Are there any special things to set?

  5. Hello,

     

    Actually I'm trying to generate an alfred workflow which make iso out of selected folders in finder.

     

    The File Action is working. But my problem is, how can I execute Shell Commands in the parent folder, so that I can run hdiutil, etc...

     

    All experiments went wrong.. Maybe anybody has a tipp for me?

     

    thx

     

×
×
  • Create New...