Jump to content

Raffie77

Member
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Raffie77's Achievements

Member

Member (4/5)

2

Reputation

  1. Let me explain: I rename a lot of photos based on information on the internet. I copy words like "bird", "trees", "fly", etc., which are then on my clipboard. I have a workflow that renames files using exiftool. In that workflow, I can also add names myself. At that point, I would like to have access to my clipboard, so that I can add different words from the clipboard to my workflow. But if I activate the clipboard, my workflow is gone (Workflow no longer has focus). The same goes for if I am in the workflow and I want to copy a difficult word that is on a website, then I cannot do that because the workflow is gone again. Is there a solution for this?
  2. In php you can include other php files. Can I also do that with bash script in Alfred?
  3. Ok tanks deanishe and vitor it starts to make sense now I still love scripting👌
  4. huh?😣 that works ok now I am confused, it's great that it works now thanks @vitor. If you take a look at the script in my first post you see a case k_basRenExtFile and k_basRenCurFile those work. and I thought I used the same technique I'm gonna study this script for a while thank you both for your time, I appreciate that very much
  5. $tracklog is set with -userparam tracklog="$clip" -userparam tracklog= "$clip" ^ ^ ^ exiftool function create a exiftool value defined in the workflow var it's clipboard content1
  6. ok this is a exiftool thing lets say if I want to see the model of a image, I type: ${exiftool} $model photo.jpg if I type: ${exiftool} -overwrite_original -geotag="${clip}" "${files[@]}" exiftool thinks I want to see the property of ${clip} and that doesn't exist that's where the -userparam kicks in -userparam tracklog="$clip" it means create a property tracklog with the value of $clip and $clip means clipboard see the screenshot and when I echo $clip I see this result in the debug: Clip = /Users/ralphschipper/Downloads/2020-05-09 17_15_25.gpx so the clip var is set correctly I hope this makes sense
  7. oh sorry I forgot to say: var tracklog is located in a var in alfred see screenshot when I add this line in te script: ${exiftool} -overwrite_original -userparam tracklog="$clip" -geotag=$tracklog "${files[@]}" echo "Clip = $clip" The debug result = Clip = /Users/ralphschipper/Downloads/2020-05-09 17_15_25.gpx I have the workflow here
  8. It's very bizar I have this script in Alfred: ####################################### #Exiftool utility for Alfred workflow # ####################################### set -x IFS=$'\t' read -ra files <<< "${file_list}" command=${command} #Located at the arg block after the List Filter in the workflow sourceFiles="/Users/$USER/temp/" case $command in basRen) #Basic rename ${exiftool} -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model.%e' "${files[@]}" ;; k_basRenExtFile) #Basic rename with an extra added name from a query ${exiftool} -userparam extName="$keyword" -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model $extName.%e' "${files[@]}" ;; k_basRenCurFile) #Rename the current file(s) with a extra query e.g. test.jpg > test foo.jpg ${exiftool} -userparam extName="$keyword" -d "%%f" '-filename<${DateTimeOriginal} $extName.%e' "${files[@]}" ;; datMap) #Move selected files to a subfolder YYYY-mm created from DateTimeOriginal exif tag, if the folder doesn't exsist create it creates that folder ${exiftool} -d "%%d/%Y-%m/%%f.%%e" '-filename<DateTimeOriginal' "${files[@]}" ;; geoTag) #Select a single file and Show it in Apple maps or Google maps. In the main vars section choose by map_provider 'Apple' or 'Google' [[ "${map_provider}" == 'Google' ]] && map_url='https://www.google.com/maps?t=k&q=' || map_url='http://maps.apple.com/?q=' coordinates="$(${exiftool} -printFormat '$gpslatitude, $gpslongitude' --printConv "${files}")" open "${map_url}${coordinates}" ;; tracklog) #Find the tracklog in finder > double tab cmd and choose 'copy path to clipboard' and run this script ${exiftool} -overwrite_original -userparam tracklog="$clip" -geotag=$tracklog "${files[@]}" ;; photos2kml) #Select photos and check if it has GPS data in the Exif, if so that create a KML file and open it in Google Earth ${exiftool} -p "${sourceFiles}gpx.fmt" -r "${files[@]}" > "${sourceFiles}photos.kml" open "${sourceFiles}" open "${sourceFiles}photos.kml" ;; dateFields) #Show alle date fields in CSV format from selected files ${exiftool} -csv -time:all -s "${files[@]}" > "${sourceFiles}exiftool_output.csv" open "${sourceFiles}exiftool_output.csv" ;; megapixels) #Show magapixels in CSV format from selected files ${exiftool} -csv -megapixels "${files[@]}" > "${sourceFiles}exiftool_output.csv" open "${sourceFiles}exiftool_output.csv" ;; basDetails) #Show basic information in CSV format from selected files, you can edit the fiels in the format file ${exiftool} -c %.7f -api filter='$_ = qq{"$_"} if s/"/""/g or /(^\s+|\s+$)/ or /[,\n\r]/' -f -p "${sourceFiles}csv.fmt" "${files[@]}" > "${sourceFiles}exiftool_output.csv" open "${sourceFiles}exiftool_output.csv" ;; *) exit ;; esac set +x All the case parts works perfect, except case tracklog the part that says: -geotag=$tracklog when I run this script I see this result in the debug screen: case $command in + /usr/local/bin/exiftool -overwrite_original -userparam 'tracklog=/Users/ralphschipper/Downloads/2020-05-09 17_15_25.gpx' -geotag= '/Volumes/Ext 1TB/Google Drive/temp/test1/MapA/P1110188.JPG' if you look at the pard -geotag= you see its blank the next part is the photo that is selected tru a File Action As I said all the rest of the cases works great except tis part. Can anyone see what I'm doing wrong here?
  9. vitor: thank you very very very much🙌 it works! I nerver heard of/used IFS=$'\t' so i read into that, now I understand I tested this and it still didn't work, the issue is, in this line: ${exiftool} -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model "${1}".%e' "${files[@]}" The "${1}" in this line doesn't work, if you take a look at $Make-$Model that means that Exiftool gets the value of the make and the model. "${1}" is not a Exiftool value, but Exiftool is reading this as a Exiftool value and that value doesn't exist. so for people who wants to know how to fix this? this is the working code: IFS=$'\t' read -ra files <<< "${file_list}" ${exiftool} -userparam extName="${1}" -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model $extName.%e' "${files[@]}" Exiftool has a option -userparam here you can create a user parameter in my case called extName (extra name) and I used that later on after the $Make-$Model I have the working version here
  10. ok I have a link to this workflow in my dropbox you can download it here yes I found your labelcolor workflow, I learned from that how to add a keyword in the file action. I hope you can take a look at this workflow. I'm not sure what I am missing here
  11. I also add a keyword in alfred in cas I want to add an extra name like "flower" of "tree" etc. in the script i have this: ${exiftool} -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model "${keyname}".%e' "${files}" If I enable the debug mode I get this message: The "$keyname" is a var that I created in Alfred see screenshot, the first var is the "$files" and the second var = "$keyname" in te script I used "$keyname" with the purpose to enter the text that I typ in Alfred, but Exiftool thinks that "$keyname" is a Exiftool code and that's not the case hence the error well single and double quotes and escaping are not my strong suite. Do I need to escape something here or split up the quotes ore something like that? btw this code below works great (without the $keyname): ${exiftool} -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model.%e' "${files}"
  12. YES that works thank you so much 🥳 this makes life a lot easier thanks
  13. ooohhh shoot, you're right I tweaked the script a bit and it almost works the link that you are refering to is ment for one single file. when I select multiple files in my new script, only one gets renamed how can I make it happen that he renames all the files I select and not just one? Do I need to convert a array or something?
  14. i want to create a script for exiftool so I want to select those files that I want to rename and copy this to the clipboard: exiftool -d "%Y-%m-%d %H,%M,%S%%-c" '-filename<${DateTimeOriginal} $Make-$Model.%e' {multiple files that are decent escaped} ok I never worked with python i'll look into that I see that I can run a Pythons script in Alfred workflow Thanks
  15. Hi, I'm trying to create a workflow that can copy paths for later use. Frist I create a new workflow and add a file action to it that accepts multiple lines then I enter a copy to clipboard module that says {query} I run this script by selecting 2 files and double tap the command key and choose my test script and I paste it textedit the result: /temp/test 1/MapA/test (2).JPG /temp/test 1/MapA/test (1).JPG the thing is when I drag the 2 files to a terminal window I get this: /test\ 1/MapA/test\ \(1\).JPG /test\ 1/MapA/test\ \(2\).JPG filenames are separated by a space and the filenames are escaped is there a script that can do this to? so when I select files it copy's the full pathnames escaped and separated by a space?
×
×
  • Create New...