+ Reply to Thread
Page 5 of 7 FirstFirst 1 2 3 4 5 6 7 LastLast
Results 41 to 50 of 61

Thread: AppleScripting PF: Problems / Howto / Questions

  1. #41
    Member
    Join Date
    Feb 2006
    Location
    Montpellier, France
    Posts
    226

    Default

    Quote Originally Posted by somethingkindawierd View Post
    I am trying to write a simple AppleScript line that will make a new folder in the folder of the current selection. The code to make a new folder causes PathFinder to quit. Any ideas on how to get PathFinder to make a new folder via AppleScript?
    Here's a workaround, using the shell to create the folder:
    Code:
    tell application "Path Finder"
    	set foldername to "untitled"
    	set selected_items to selection
    	repeat with one_item in selected_items
    		tell me to set posix_path to POSIX path of one_item
    		set k to kind of one_item
    		if k = "Folder" then
    			set cmd to "mkdir " & quoted form of (posix_path & "/" & foldername)
    			do shell script cmd
    		end if
    	end repeat
    end tell

  2. #42
    Member
    Join Date
    Feb 2006
    Location
    Montpellier, France
    Posts
    226

    Default

    Quote Originally Posted by WCityMike View Post
    There's an AppleScript I'd like to tweak to work in Path Finder. It's described at this Mac OS X Hints hint.

    The function of the AppleScript is to be mapped with Quicksilver to the Command-Delete button. This way, when you delete an app via the keyboard, it sends it to AppZapper instead of the trash (and will eject a volume if you try to 'delete' it).
    Here's a version that works around PF's limitations by using the shell:
    Code:
    tell application "Path Finder"
    	set selected_items to selection
    	repeat with one_item in selected_items
    		tell me to set posix_path to POSIX path of one_item
    		set k to kind of one_item
    		if k = "Application" then
    			set cmd to "open -b com.appzapper.appzapper " & quoted form of posix_path
    			do shell script cmd
    		else if k = "Volume" then
    			eject one_item
    		else
    			set cmd to "mv " & quoted form of posix_path & " " & "~/.Trash/"
    			do shell script cmd
    		end if
    	end repeat
    end tell
    Note that it doesn't check if PF is frontmost because "if frontmost" fails too. If you want to make sure that PF is frontmost (and I think you do), you'll have to find another way. I think you can get the frontmost process from the "System Events" process. Good luck.

  3. #43
    Member
    Join Date
    Jan 2007
    Location
    Chicago, Illinois
    Posts
    22

    Default

    Quote Originally Posted by flip View Post
    Here's a version that works around PF's limitations by using the shell:
    Thanks! I have iKey, which one can instruct to only run a macro if something's the frontrunning app, so that's taken care of. Thanks.
    Last edited by WCityMike; Jan 28, 2007 at 09:07 AM.

  4. #44

    Default open multiple PathFinder windows at the same folder with applescript

    Hi,

    I would like to open multiple Path Finder windows at my user-folder "/user/name" with Applescript. I want new windows like pressing "Apple + N".

    I suspected something like
    tell application "Path Finder"
    make new window
    open new window
    make new finder window
    end tell

    nothing works :-(
    I tried some commands found in the forum, but nothing works with with two window at the same folder.

    And I need a way to count the windows.
    tell application "Path Finder" to set n to number of windows
    gives a number - but higher than the count of the windows.

    muetze

  5. #45
    Member
    Join Date
    Feb 2006
    Location
    Montpellier, France
    Posts
    226

    Default

    See the long message I posted in this thread: http://www.cocoatech.com/forum/showthread.php?t=2869

    Everything you need is there.

  6. #46

    Default

    I'm sorry, reveal, open and PFopen won't work, because I will open many windows at the same folder - e.g. homedir

    repeat with n from 1 to 10
    reveal home
    end repeat

    gives me only one browser window. I will not interact, while the window are opening.

    I can't find an answer to the question: How can I count the number of browser windows?

    muetze

  7. #47
    Cocoatech Valued Contributor grotsasha's Avatar
    Join Date
    Dec 2005
    Location
    Düsseldorf, Germany
    Posts
    1,739

    Default

    Each browser window in PF is actually technically two windows (one of them being hidden) as far as I remember, so probably dividing "set n to number of windows" by 2 should give you the correct result. Not sure though.

    eMac G4 1,25 GHz 768 Mb
    Black MacBook 2,16 GHz 2 GB RAM
    10.5

  8. #48

    Default

    No sorry, I had one open window and the count was 8... But every new window rises the number by 2. Sometimes I had an other value for the count of the windows.

    muetze

  9. #49

    Question Want to recreate simple workflow/Finder-plugin for PF

    I have a folder (~/Current Projects/) that I use to store aliases to, you guessed it, my current projects. Before I started using PF, I was using a very simple Automator workflow/Finder plugin that, when clicked in the contextual menu, simply made an alias of the currently selected file(s) and put said alias(es) in the Current Projects folder. But because the workflow depends to the Finder>Get Selected Item(s) action, it doesn't work in PF. Any ideas on how to duplicate the functionality? I'm sure it can be done in Applescript (and then wrapped in an Automator plugin), but I know about as much AppleScript as I do ancient Greek (that is, none).

    I attached a screenshot of the workflow, if you need clarification.
    Attached Images

  10. #50

    Default Support for Finder Plugins

    I have just implemented a new file automator workflow in Finder using the solution created by Yellow Camp Software. This seems a particularly powerful way to create new files from the Finder as it supports any file types defined by extension.

    Is there anyway that PF4.7 can support a workflow of this type, ideally via a contextual menu or some other means?

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts