You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to locate all PageMaker files on my Mac

I'm trying to locate all PageMaker files on my Mac. It's difficult because they bare no common extension, for that matter, no extension at all.

Can use AppleScript to collect a list of file names for any file with any of the following Creator codes. If so, any suggestions?

I've successfully used Mac OS's Spotlight to find my PageMaker documents ... employing command-F, with the Other/Creator or Other/Type option.

I know this much about the Creator codes, but I don't know how to make a complete list of files. Seems like AppleScript would be great for that task:

PageMaker 6.5: (roughly 1998)
Creator: AB65
Type: AD65

PageMaker 4.1 (roughly 1992)
Creator: ALD4
Type: ALB4

PageMaker 3
Creator: ALD3

PageMaker 2 (roughly 1988)
Creator: ALD2
Type: PUBF

PowerBook G4, Mac OS X (10.4.7)

Posted on May 28, 2007 7:35 PM

Reply
5 replies

May 28, 2007 8:26 PM in response to John Blasquez

Try using code such as:

tell application "Finder"
set the_path to startup disk
set the_names to {}
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "AD65")
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "ALB4")
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "PUBF")
set the_names to the_names & name of (every file of entire contents of the_path whose creator type is "ALD3")
end tell

(21905)

May 29, 2007 7:24 AM in response to Niel

Try using code such as:


tell application "Finder"
set the_path to startup disk
set the_names to {}
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "AD65")
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "ALB4")
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "PUBF")
set the_names to the_names & name of (every file of entire contents of the_path whose creator type is "ALD3")
end tell

Thanks Neil.

When I run the script I hear a lot of disk access, and then eventually AppleScript times out.

Looks like a good start. So the script doesn't search needless places, and since all my document are in the Documents folder, perhaps I should narrow the initial path to startup disk "Macintosh HD:Users:John:Documents"

What's the correct syntax for that? Any other sugggestions for getting this to work?

Thanks! John

May 29, 2007 8:47 AM in response to John Blasquez

Here:

tell application "Finder"
with timeout of 600 seconds
set the_path to folder "Macintosh HD:Users:John:Documents"
set the_names to {}
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "AD65")
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "ALB4")
set the_names to the_names & name of (every file of entire contents of the_path whose file type is "PUBF")
set the_names to the_names & name of (every file of entire contents of the_path whose creator type is "ALD3")
end timeout
end tell

(21915)

May 30, 2007 11:36 PM in response to Niel

This also freezes the Finder. After 40 minutes of the spinning beachball, and no results in the AppleScript window, the only way out was a main power button restart.

tell application "Finder"
with timeout of 600 seconds
set the_path to folder "Macintosh HD:Users:John:Documents"
set the_names to {}
set the_names to the_names & name of (every file of entire contents of
the_path whose file type is "AD65")
set the_names to the_names & name of (every file of entire contents of
the_path whose file type is "ALB4")
set the_names to the_names & name of (every file of entire contents of
the_path whose file type is "PUBF")
set the_names to the_names & name of (every file of entire contents of
the_path whose creator type is "ALD3")
end timeout
end tell

May 31, 2007 3:17 AM in response to John Blasquez

Hello John Blasquez,

AppleScript's filter reference by 'whose' clause can be sadly slow in filtering large set of objects. Since it has been so for a long time, you'd better find another way when it is too slow.

I'd try mdfind(1) to invoke Spotlight query (OSX10.4 or later) from command line. E.g. -

# SHELL COMMAND (NOT tested)
# mdfind e.g. to obtain paths of PageMaker files under Home directory.
mdfind -onlyin ~ "kMDItemKind == ' PageMaker' || kMDItemCreator == ' PageMaker'"
# END OF SHELL COMMAND


And in AppleScript, you may use 'do shell script' to execute shell command. E.g. -

-- SCRIPT (NOT tested)
set outfp to "" & (path to "desk") & "test out.txt"
set query to "\"kMDItemKind == ' PageMaker' || kMDItemCreator == ' PageMaker'\""
set s to "mdfind -onlyin ~ " & query & " > " & quoted form of POSIX path of outfp
do shell script s
-- END OF SCRIPT


I have not tested them, for I don't use OSX myself.
Hope this may be of some help.
H

PS. Spotlight query will (generally) work fine for user home in local volume, but will not for any un-indexed directories, such as under /System and/or CD/DVD volumes (and perhaps under network volumes either, not sure though.)


cf.
mdfind(1)
mdfind.1.html

Spotlight Metadata Attributes Reference

Spotlight Query Programming Guide

Technical Note about 'do shell script'
http://developer.apple.com/technotes/tn2002/tn2065.html




Mac OS 9.1.x

Trying to locate all PageMaker files on my Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.