Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Gerzer
Created June 27, 2015 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gerzer/2e9e421ccdd38155b357 to your computer and use it in GitHub Desktop.
Save Gerzer/2e9e421ccdd38155b357 to your computer and use it in GitHub Desktop.
Import File.py
# coding: utf-8
import appex
import os
import shutil
def main():
if not appex.is_running_extension():
print 'ERROR: This script is meant to be run from the sharing extension.'
else:
input_files = appex.get_attachments()
for input_file in input_files:
head, tail = os.path.split(input_file)
shutil.copy(input_file, tail)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment