Reply
Page 5 of 7:  < 1  2  3  4  5  6  7   Next >
Thread Tools Search this Thread   Switch to Linear ModeSwitch to Hybrid ModeSwitch to Threaded Mode
flip
Member

Join Date: Feb 2006
Location: Montpellier, France
Posts: 226
Posted Jan 27, 2007, 04:20 PM #41
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
Reply With Quote
flip
Member

Join Date: Feb 2006
Location: Montpellier, France
Posts: 226
Posted Jan 27, 2007, 04:30 PM #42
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.
Reply With Quote
WCityMike
Member

Join Date: Jan 2007
Location: Chicago, Illinois
Posts: 22
Send a message via AIM to WCityMike Send a message via Skype™ to WCityMike
Posted Jan 28, 2007, 09:59 AM #43
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 10:07 AM.
Reply With Quote
muetze
Member

Join Date: Apr 2007
Posts: 10
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
Reply With Quote
flip
Member

Join Date: Feb 2006
Location: Montpellier, France
Posts: 226
Posted Apr 11, 2007, 03:43 PM #45
See the long message I posted in this thread: http://www.cocoatech.com/forum/showthread.php?t=2869

Everything you need is there.
Reply With Quote
muetze
Member

Join Date: Apr 2007
Posts: 10
Posted Apr 12, 2007, 01:57 AM #46
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
Reply With Quote
grotsasha
grotsasha's Avatar
Cocoatech

Join Date: Dec 2005
Location: Düsseldorf, Germany
Posts: 1,739
Posted Apr 12, 2007, 03:03 AM #47
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
Reply With Quote
muetze
Member

Join Date: Apr 2007
Posts: 10
Posted Apr 12, 2007, 07:58 AM #48
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
Reply With Quote
GoBecky
Member

Join Date: Apr 2007
Posts: 1
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
File Type: jpg FlySketchWorkflow-2007.jpg (33.5 KB, 2 views)
Reply With Quote
SteveH
SteveH's Avatar
Member

Join Date: Jun 2007
Posts: 9
Support for Finder Plugins, Posted Jun 18, 2007, 03:49 PM #50
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 With Quote
Reply « Previous Thread - Support - Next Thread »
Page 5 of 7:  < 1  2  3  4  5  6  7   Next >
Thread Tools Display Modes Search this Thread
Linear Mode Linear Mode

Advanced Search
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All times are GMT -7. The time now is 06:25 AM.