Jump to content

Panay.is

Member
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Panay.is

  1. Updated script for anyone who wishes to use it for themselves --Locate File user wishes to reverse search tell application "Finder" set sel to the selection as text set the clipboard to POSIX path of sel end tell --perform search in Google Chrome activate application "Google Chrome" tell application "System Events" to tell process "Google Chrome" delay 1 keystroke "t" using command down keystroke "v" using command down key code 36 delay 1.5 set myBounds to bounds of window 1 of application "Google Chrome" set x to item 1 of myBounds set y to item 2 of myBounds do shell script "/Users/admin/cliclick m:" & x & "," & y & "w:100 kd:ctrl c:+2,+74 ku:ctrl w:1000 c:+66,+90 w:700" end tell --close file tab google chrome leaving only search result open tell application "Google Chrome" set windowList to every tab of every window whose URL starts with "file://" repeat with tabList in windowList set tabList to tabList as any repeat with tabItr in tabList set tabItr to tabItr as any delete tabItr end repeat end repeat end tell NOTE: As before cliclick must be installed in User/home/.. for the right click to work Chrome needs to be installed and preferably active in the dock due to this script being based on action delays. Annd as the workflow uses cliclick to emulate clicks within chrome to reverse search the image - moving the mouse while the workflow is going will more often than not result in *right-click* “Search Google by Image” failing. EDIT: Included in the form of a workflow export http://cl.ly/0u3Y2P1q2L43
  2. Been trying to get that part to work all day didn't even think of getting Finder to do it itself Just set it up as a workflow and ran it through Alfred for the first time.... That unbelievably awesome feeling of seeing it work how it was intended to work Time to tidy it up Thank you!! I do have one more question i'm struggling to find an answer to deep in the forums - with cliclick is there a particular way to reference to it if I store it within the workflow folder?
  3. I'm extremely new to applescript and alfred for that matter so I have absolutely no idea if this is going the right way or not. So far I've managed to get applescript to take a predefined file (URL given to it by me before hand) have it load into chrome and then use chromes right click->search by image function. Any advice would be appreciated on how to take it further! The next step in my mind is trying to work out how on earth to get alfred to pass a file into the script! It's very a gritty script but it's finally working at least >,< set myFile to "file:///Users/admin/Desktop/Google%20Drive/Applescript/ReverseSearch/photo.jpg" --do not move mouse while this is running activate application "Google Chrome" tell application "System Events" to tell process "Google Chrome" delay 1 set the clipboard to myFile keystroke "t" using command down keystroke "v" using command down key code 36 delay 2 do shell script "/Users/admin/cliclick kd:ctrl c:700,500 ku:ctrl" delay 1 do shell script "/Users/admin/cliclick c:766,590" delay 1 end tell --close image opened in previous Chrome tab tell application "Google Chrome" set windowList to every tab of every window whose URL starts with "file://" repeat with tabList in windowList set tabList to tabList as any repeat with tabItr in tabList set tabItr to tabItr as any delete tabItr end repeat end repeat end tell NOTE: Cliclick must be located in home for the right click to work and the browser has to be in the middle of the screen currently while I work on calculating the bounds of the users browser and finding the top left most corner of the image for the right click to be effective!
×
×
  • Create New...