Jump to content
timogeib

Placing Files in InDesign using Alfred Commands

Recommended Posts

Hey,

 

is there anyone who might be able to tell if its possible to place files in InDesign using the Alfred "File Nav & Result Actions"?

I think that would be a super handy feature for everybody using InDesign and Alfred.

 

Thanks in Advance

Share this post


Link to post

A few years later, but id love to have this too.

 

I've got the applescript i feel would be involved. Im just having a tough time applying to Alfred :(

 

set myNameFile to "file path from alfred"

 

tell application "Adobe InDesign CC 2017"

    activate

    set myDoc to active document

    tell page 1 of myDoc

        set myRectangle to make rectangle with properties {geometric bounds:{25.6, 13.6, 709.6, 402.4}}

        try

            place alias (myNameFile) on myRectangle

            fit rectangle 1 given center content

        on error

            -- do your stuff

        end try

    end tell

    

    tell document 1

        set transform reference point of layout window 1 to center anchor

        --set theImages to all page items -- scales rectangle

        set theImages to all graphics -- scales the graphic only

        repeat with i from 1 to count of theImages

            set MyImage to item i of theImages

            set absolute horizontal scale of MyImage to 100

            set absolute vertical scale of MyImage to 100

        end repeat

    end tell

end tell

Share this post


Link to post

Hi dsburfitt.

 

I'm very late to the conversation here, but I hoped to find if you were ultimately able to get the Applescript to work just by replacing that first line with dfay's recommended "POSIX" line. With that edit, I can file-action my script to run as far as activating InDesign (CS6 in my case…changed the app's name in my script), but no placement of the Alfred-actioned file occurs. From what I read of Applescript in InDesign, it shouldn't matter that I'm attempting this with CS6 rather than CC 2017. Just wondering if you needed to otherwise tweak you original script to get it working. Thanks for your time.

Share this post


Link to post

Hey Imurban,

 

I modified it quite a bit since. If you wanted to compare my old script above...to this...

on alfred_script(q)
tell application "Finder"
	set myNameFile to (get selection as alias)
end tell
tell application "Adobe InDesign CC 2017"
	activate
	set myDoc to active document
	tell page 1 of myDoc
		set myRectangle to make rectangle with properties {geometric bounds:{25.6, 13.6, 709.6, 402.4}}
		try
			place myNameFile on myRectangle
			fit rectangle 1 given center content
		on error
			-- do your stuff
		end try
	end tell

I found setting it as an alias was less complicated.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...