codez / ImportPhotoFolders

Import a folder hierarchy as albums into OS X Photos.
MIT License
246 stars 42 forks source link

How to have script run on a specific folder everytime #12

Closed profucius closed 8 years ago

profucius commented 8 years ago

I have a specific folder on my Mac where my photos are imported from my phone to my Mac every time I am on my local wifi. This folder then needs to be imported into Photos.

I love this script, but I need to change something in it to instead of asking for the input folder on each run, that it will automatically run with the aforementioned specific folder I want to hardcode into the script.

How do I do this? (I'm a novice applescripter, need some direction) Thanks

codez commented 8 years ago

You have to adjust line 2 of the script (https://github.com/codez/ImportPhotoFolders/blob/master/ImportPhotoFolders.applescript#L2) to something like set folderList to {"/Users/you/phone_pictures"}.

Please refer to the apple script documentation if the folder path is not accepted in this form.

profucius commented 8 years ago

Thanks for replying. I tried that but I got an error. Sorry to open this up again but I don't know where to look for the answer inside the documentation.

Here is what I put in your script (top two lines):

on run
    set folderList to {"/Volumes/iDox/test"}

And here is the error I get:

Script Error: Can’t make name of item 1 of {"/Volumes/iDox/test"} into type text.

Any idea why that is, or can you point me in the right direction please? I appreciate your help.

codez commented 8 years ago

I would also have to look up where to look this up. Please refer to an apple script support forum for help.

ghost commented 7 years ago

@profucius The error is a result of a problem with classes; the script is getting information as a POSIX path and trying to process it as an HFS path string.

Does changing line 2 to the following work?

set folderList to ("/Volumes/iDox/test" as )