bash - Peroidcly running osascript in shell script to run apple script -


what i'm doing

i running shell script periodically checks resolution of screen. based on run 1 of 2 apple scripts changes visibility on application (geek tools).

my problem

the apple scrip runs fine self. understand osascript way call apple script, because if try run directly says "cannot execute binary file". when use osascript $home/path/smallscreen.scpt gives me new error:

osascript[61390:1405791] error loading /library/scriptingadditions/adobe unit types.osax/contents/macos/adobe unit types:  dlopen(/library/scriptingadditions/adobe unit types.osax/contents/macos/adobe unit types, 262): no suitable image found.   did find: /library/scriptingadditions/adobe unit types.osax/contents/macos/adobe unit types: no matching architecture in universal wrapper osascript: openscripting.framework - scripting addition "/library/scriptingadditions/adobe unit types.osax" declares no loadable handlers. 

maybe i'm misunderstanding thought should straight forward run script bottom of answer: https://stackoverflow.com/a/16071855/2522073

claiming can run apple script osascript /users/username/desktop/foo.scpt


shell code:

rez=$(xdpyinfo | grep dimensions | awk '{print $2}' | awk -fx '{print $1, $2}') echo $rez> $home/documents/geeklets/displays_temp.txt rezold=`grep -s . $home/documents/geeklets/displays_temp.txt`  if [ "$rezold" != "$rez" ];     if [ "$rez" == "1280 777" ];         osascript /users/coolguy/documents/geeklets/smallscreen.scpt      else         $home/scripts/geeklets/largescreen.scpt     fi   fi 

my apple script:

tell application "geektool helper"      set smallgroup group "small"     set largegroup group "large"     set defultgroup group "default group"      set visible of smallgroup true     set visible of largegroup false     set visible of defultgroup true    end tell 

i'm running on mac 10.10.3

this solved problem. https://helpx.adobe.com/photoshop/kb/unit-type-conversion-error-applescript.html

it seems side of 32bit vs 64bit issue. not coding issue! hope ends helping else.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -